From ac2453d561312852d66d8eaa65a7d5fcf6982996 Mon Sep 17 00:00:00 2001 From: Brian Lovin Date: Fri, 6 Mar 2020 18:47:36 -0800 Subject: [PATCH 1/2] Refactor site to be more visually simple, add new content --- .gitignore | 4 +- now.json | 36 ++-- src/components/Bookmarks/index.tsx | 4 - src/components/Bookmarks/style.tsx | 18 +- src/components/DesignDetailView/index.tsx | 2 +- src/components/DesignDetailsCard/style.tsx | 23 +-- src/components/DesignDetailsPlayer/index.tsx | 98 --------- src/components/DesignDetailsPlayer/style.tsx | 102 ---------- src/components/FigmaPlugins/index.tsx | 67 ++++--- src/components/FigmaPlugins/style.tsx | 31 --- src/components/GlobalStyles/index.tsx | 19 +- src/components/GlobalStyles/markdown.tsx | 8 - src/components/GlobalStyles/reset.tsx | 6 - src/components/Overthought/Grid/index.tsx | 23 --- src/components/Overthought/List/ListItem.tsx | 26 --- src/components/Overthought/List/index.tsx | 26 ++- src/components/Overthought/List/style.tsx | 76 ------- src/components/Overthought/Post/index.tsx | 37 ++-- .../Overthought/PreviewCard/index.tsx | 18 +- .../Overthought/PreviewCard/style.tsx | 3 - src/components/Page/style.tsx | 10 +- src/components/PodcastEpisodesList/index.tsx | 55 +++++ src/components/Theme/index.ts | 4 +- src/components/Typography/index.tsx | 11 +- src/pages/about.tsx | 4 +- src/pages/api/bookmarks/get.ts | 1 - src/pages/api/newsletter.ts | 1 - src/pages/bookmarks.tsx | 5 +- src/pages/design-details/index.tsx | 4 +- src/pages/index.tsx | 189 +++++++++++++----- src/pages/overthought/index.tsx | 11 +- 31 files changed, 350 insertions(+), 572 deletions(-) delete mode 100644 src/components/DesignDetailsPlayer/index.tsx delete mode 100644 src/components/DesignDetailsPlayer/style.tsx delete mode 100644 src/components/FigmaPlugins/style.tsx delete mode 100644 src/components/Overthought/Grid/index.tsx delete mode 100644 src/components/Overthought/List/ListItem.tsx delete mode 100644 src/components/Overthought/List/style.tsx create mode 100644 src/components/PodcastEpisodesList/index.tsx diff --git a/.gitignore b/.gitignore index 29c76dde2..d466ab9e2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,7 @@ node_modules .next .DS_Store .env +.env.build .vscode -yarn-error.log \ No newline at end of file +yarn-error.log +.now \ No newline at end of file diff --git a/now.json b/now.json index d9cc60a37..9fd431567 100644 --- a/now.json +++ b/now.json @@ -3,22 +3,24 @@ "github": { "silent": true }, - "env": { - "MAILCHIMP_API_KEY": "@mailchimp-api-key", - "MAILCHIMP_LIST_ID": "@mailchimp-list-id", - "TWILIO_ACCOUNT_SID": "@twilio-account-sid", - "TWILIO_AUTH_TOKEN": "@twilio-auth-token", - "TWILIO_PHONE_NUMBER": "@twilio-phone-number", - "MY_PHONE_NUMBER": "@my-phone-number", - "FIREBASE_TYPE": "@firebase-type", - "FIREBASE_PROJECT_ID": "@firebase-project-id", - "FIREBASE_PRIVATE_KEY_ID": "@firebase-private-key-id", - "FIREBASE_PRIVATE_KEY": "@firebase-private-key", - "FIREBASE_CLIENT_EMAIL": "@firebase-client-email", - "FIREBASE_CLIENT_ID": "@firebase-client-id", - "FIREBASE_AUTH_URI": "@firebase-auth-uri", - "FIREBASE_TOKEN_URI": "@firebase-token-uri", - "FIREBASE_AUTH_PROVIDER_X509_CERT_URL": "@firebase-auth-provider-x509-cert-url", - "FIREBASE_CLIENT_X509_CERT_URL": "@firebase-client-x509-cert-url" + "build": { + "env": { + "MAILCHIMP_API_KEY": "@mailchimp-api-key", + "MAILCHIMP_LIST_ID": "@mailchimp-list-id", + "TWILIO_ACCOUNT_SID": "@twilio-account-sid", + "TWILIO_AUTH_TOKEN": "@twilio-auth-token", + "TWILIO_PHONE_NUMBER": "@twilio-phone-number", + "MY_PHONE_NUMBER": "@my-phone-number", + "FIREBASE_TYPE": "@firebase-type", + "FIREBASE_PROJECT_ID": "@firebase-project-id", + "FIREBASE_PRIVATE_KEY_ID": "@firebase-private-key-id", + "FIREBASE_PRIVATE_KEY": "@firebase-private-key", + "FIREBASE_CLIENT_EMAIL": "@firebase-client-email", + "FIREBASE_CLIENT_ID": "@firebase-client-id", + "FIREBASE_AUTH_URI": "@firebase-auth-uri", + "FIREBASE_TOKEN_URI": "@firebase-token-uri", + "FIREBASE_AUTH_PROVIDER_X509_CERT_URL": "@firebase-auth-provider-x509-cert-url", + "FIREBASE_CLIENT_X509_CERT_URL": "@firebase-client-x509-cert-url" + } } } \ No newline at end of file diff --git a/src/components/Bookmarks/index.tsx b/src/components/Bookmarks/index.tsx index 05f47bb47..872f34d68 100644 --- a/src/components/Bookmarks/index.tsx +++ b/src/components/Bookmarks/index.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { Bookmark } from '~/types' -import { P } from '../Typography'; import { ListItem, Grid, Url, Title } from './style' interface Props { @@ -11,11 +10,8 @@ function BookmarkListItem({ bookmark }: { bookmark: Bookmark }) { return ( - <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" ><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg> - {bookmark.title || bookmark.url} - {bookmark.description &&

{bookmark.description.slice(0, 140)}...

} {bookmark.host || bookmark.url}
) diff --git a/src/components/Bookmarks/style.tsx b/src/components/Bookmarks/style.tsx index 572278406..028bf107f 100644 --- a/src/components/Bookmarks/style.tsx +++ b/src/components/Bookmarks/style.tsx @@ -4,9 +4,10 @@ import { p } from '../Typography' export const Grid = styled.div` display: grid; - max-width: ${defaultTheme.breakpoints[3]}; - margin-top: ${defaultTheme.space[7]}; - grid-gap: ${defaultTheme.space[6]}; + width: 100%; + max-width: ${defaultTheme.breakpoints[4]}; + margin-top: ${defaultTheme.space[5]}; + grid-gap: ${defaultTheme.space[3]}; grid-template-columns: 1fr; @media (max-width: ${defaultTheme.breakpoints[4]}) { @@ -17,23 +18,14 @@ export const Grid = styled.div` export const Title = styled.p` ${p}; - font-size: 1.1rem; font-weight: 700; display: grid; align-items: center; - grid-gap: ${defaultTheme.space[3]}; - grid-template-columns: 16px 1fr; - - @media (max-width: ${defaultTheme.breakpoints[4]}) { - grid-template-columns: 1fr; - - svg { display: none } - } ` export const ListItem = styled.a` display: grid; - grid-gap: ${defaultTheme.space[2]}; + grid-gap: ${defaultTheme.space[0]}; grid-template-columns: 1fr; &:hover { diff --git a/src/components/DesignDetailView/index.tsx b/src/components/DesignDetailView/index.tsx index 493f2a5ec..b4896411c 100644 --- a/src/components/DesignDetailView/index.tsx +++ b/src/components/DesignDetailView/index.tsx @@ -49,7 +49,7 @@ export default function DesignDetailView(props: Props) { A visual exploration of digital products - View all posts + See all posts diff --git a/src/components/DesignDetailsCard/style.tsx b/src/components/DesignDetailsCard/style.tsx index 8e8824c34..37c619a22 100644 --- a/src/components/DesignDetailsCard/style.tsx +++ b/src/components/DesignDetailsCard/style.tsx @@ -33,7 +33,7 @@ export const Container = styled.div` border-radius: 8px; transition: ${defaultTheme.animations.default}; align-items: flex-start; - height: 400px; + height: 360px; overflow: hidden; z-index: 3; @@ -101,26 +101,7 @@ export const VideoPlayer = styled.video` min-height: 600px; border-radius: 4px; clip-path: padding-box; - - @media (min-width: 1440px) { - right: -48px; - } - - @media (max-width: 1440px) { - right: -24%; - } - - @media (max-width: 1256px) { - right: -18%; - } - - @media (max-width: 1024px) { - right: -15%; - } - - @media (max-width: 968px) { - right: -20px; - } + right: -3%; @media (max-width: 968px) { display: none; diff --git a/src/components/DesignDetailsPlayer/index.tsx b/src/components/DesignDetailsPlayer/index.tsx deleted file mode 100644 index 0205e78c5..000000000 --- a/src/components/DesignDetailsPlayer/index.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import React from 'react'; -import VisibilitySensor from 'react-visibility-sensor'; -import useDarkMode from 'use-dark-mode' -import { getDateObject } from '~/lib/getDateObject' -import { podcast } from '~/data'; -import LoadingSpinner from '~/components/LoadingSpinner'; -import SubscriptionButtons from '~/components/SubscriptionButtons' -import { H5, P, Rarr } from '~/components/Typography' -import { OuterContainer, PlayerContainer, ContentContainer, EpisodeCard, CardContent, Date } from './style' -import { PreviewContentGrid } from '../Page'; - -interface Props { - showMoreEpisodes: boolean -} - -export default function LatestEpisode({ showMoreEpisodes }: Props) { - const [episodes, setEpisodes] = React.useState(null) - const [loading, setLoading] = React.useState(false) - const { value } = useDarkMode(false, { storageKey: null, onChange: null }) - - async function fetchEpisode() { - setLoading(true) - return await fetch('https://spec.fm/api/podcasts/1034/episodes') - .then(res => { - return res.json(); - }) - .then(res => { - const episodes = res.filter(ep => !!ep.published); - setLoading(false) - setEpisodes(episodes) - }) - .catch(() => { - setLoading(false) - }); - } - - if (!episodes || loading) { - return ( - visible && fetchEpisode()}> - - - - - - - - - - ); - } - - const [featured, ...allEpisodes] = episodes - const { sharing_url } = featured; - const [, id] = sharing_url.split('s/'); - - if (!id) return null; - - return ( - - - -