diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c162b9488eaefce02e904fc75edc26af445b92a1..0a17d79ceb8c5c94232ecd1242a7d8881cba5ec5 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,8 +3,10 @@ "dbaeumer.vscode-eslint", "EditorConfig.EditorConfig", "esbenp.prettier-vscode", - "jpoissonnier.vscode-styled-components", - "prisma.vscode-graphql", - "stylelint.vscode-stylelint" + "stylelint.vscode-stylelint", + "CoenraadS.bracket-pair-colorizer-2", + "saionaro.smart-css-autocomplete", + "VisualStudioExptTeam.vscodeintellicode", + "bradlc.vscode-tailwindcss" ] } diff --git a/gatsby-config.js b/gatsby-config.js deleted file mode 100644 index 7d3fd399165e0ed567730b46fdb892f9743009d0..0000000000000000000000000000000000000000 --- a/gatsby-config.js +++ /dev/null @@ -1,42 +0,0 @@ -module.exports = { - siteMetadata: { - title: 'Schönherz Design Stúdió', - description: 'A Simonyi Károly Szakkollégium kreatív alkotóműhelye.', - language: 'hu', - email: 'hello@schdesign.hu', - siteBehanceURL: 'https://www.behance.net/wearethesds/', - siteFacebookURL: 'https://www.facebook.com/schonherzdesignstudio/', - siteInstagramURL: 'https://www.instagram.com/schdesign.hu/', - }, - plugins: [ - { - resolve: 'gatsby-source-filesystem', - options: { - name: 'data', - path: `${__dirname}/src/data/`, - }, - }, - 'gatsby-transformer-sharp', - 'gatsby-transformer-yaml', - { - resolve: 'gatsby-plugin-manifest', - options: { - /* eslint-disable @typescript-eslint/camelcase */ - name: 'Schönherz Design Stúdió', - short_name: 'schdesign', - start_url: '/', - background_color: '#3d3d3d', - theme_color: '#f8485e', - display: 'standalone', - icon: 'src/assets/favicon.png', - legacy: true, - /* eslint-enable */ - }, - }, - 'gatsby-plugin-remove-serviceworker', - '@rhysforyou/gatsby-plugin-react-helmet-async', - 'gatsby-plugin-sharp', - 'gatsby-plugin-styled-components', - 'gatsby-plugin-typescript', - ], -}; diff --git a/package.json b/package.json deleted file mode 100644 index d1a63be753192ac9c983a3f1efa3f892e72e0959..0000000000000000000000000000000000000000 --- a/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "private": true, - "scripts": { - "build": "gatsby build", - "develop": "gatsby develop --open", - "format": "prettier --ignore-path .gitignore --write \"**/*.{ts,tsx,js,json,yml,md}\"", - "lint": "npm run lint:es && npm run lint:style", - "lint:es": "eslint --ignore-path .gitignore \"**/*.{ts,tsx,js}\"", - "lint:style": "stylelint --ignore-path .gitignore \"src/**/*.{ts,tsx,js}\"", - "type-check": "tsc --noEmit" - }, - "dependencies": { - "@rhysforyou/gatsby-plugin-react-helmet-async": "^0.1.1", - "babel-plugin-styled-components": "^1.10.0", - "gatsby": "^2.7.1", - "gatsby-image": "^2.1.0", - "gatsby-plugin-manifest": "^2.1.1", - "gatsby-plugin-remove-serviceworker": "^1.0.0", - "gatsby-plugin-sharp": "^2.1.0", - "gatsby-plugin-styled-components": "^3.0.7", - "gatsby-plugin-typescript": "^2.0.14", - "gatsby-source-filesystem": "^2.0.37", - "gatsby-transformer-sharp": "^2.1.19", - "gatsby-transformer-yaml": "^2.1.12", - "react": "^16.8.6", - "react-dom": "^16.8.6", - "react-helmet-async": "^1.0.2", - "react-images": "^1.0.0-alpha.5", - "rebass": "^3.1.0", - "smoothscroll-polyfill": "^0.4.4", - "styled-components": "^4.2.0", - "styled-icons": "^7.15.1" - }, - "devDependencies": { - "@types/react": "^16.8.18", - "@types/react-helmet-async": "^1.0.0", - "@types/rebass": "^3.0.4", - "@types/smoothscroll-polyfill": "^0.3.1", - "@types/styled-components": "^4.1.15", - "@typescript-eslint/eslint-plugin": "^1.9.0", - "eslint": "^5.16.0", - "eslint-config-airbnb": "^17.1.0", - "eslint-config-prettier": "^4.3.0", - "eslint-plugin-import": "^2.17.2", - "eslint-plugin-jsx-a11y": "^6.2.1", - "eslint-plugin-prettier": "^3.1.0", - "eslint-plugin-react": "^7.13.0", - "eslint-plugin-react-hooks": "^1.6.0", - "prettier": "^1.17.1", - "stylelint": "^10.0.1", - "stylelint-config-prettier": "^5.2.0", - "stylelint-config-rational-order": "^0.1.2", - "stylelint-config-recommended": "^2.2.0", - "stylelint-config-styled-components": "^0.1.1", - "stylelint-order": "^3.0.0", - "stylelint-processor-styled-components": "^1.7.0", - "typescript": "^3.5.0-rc" - } -} diff --git a/src/components/AboutSection.tsx b/src/components/AboutSection.tsx deleted file mode 100644 index 606c5d63a18065f2293b0466e006816e85a81433..0000000000000000000000000000000000000000 --- a/src/components/AboutSection.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import React from 'react'; -import { Flex, Heading, Text } from 'rebass'; -import { ThemeConsumer } from 'styled-components'; -import Container from './Container'; -import List from './List'; -import ListItem from './ListItem'; -import Paragraph from './Paragraph'; -import Section, { Props } from './Section'; - -import aboutSectionBackgroundSrc from '../assets/about-section-background.svg'; - -const AboutSection = (props: Props) => ( - <ThemeConsumer> - {theme => ( - <Section - {...props} - bg={[null, null, 'red']} - py={[null, null, 3, 5]} - css={` - @media (min-width: ${theme.breakpoints[1]}px) { - background-image: ${`url(${aboutSectionBackgroundSrc});`}; - background-size: 100% 100%; - } - `} - > - <Container - as={Flex} - flexDirection={['column', null, 'row']} - alignItems="center" - px={null} - > - <Container flex={1} my={3}> - <Heading textAlign={['center', null, 'left']}>Rólunk</Heading> - - <Paragraph> - A Schönherz Design Stúdió a Simonyi Károly Szakkollégium kreatív - alkotóműhelye. - </Paragraph> - - <Paragraph> - Bármilyen designnal, arculattervezéssel kapcsolatos feladattal - szívesen foglalkozunk, legyen az egy weboldal, egy plakát vagy - akár egy mobilalkalmazás megtervezése. - </Paragraph> - - <Paragraph> - Keress minket projektmunkákkal, vagy nyerj betekintést a - világunkba workshopjaink alkalmával! - </Paragraph> - </Container> - - <Container - as={Text} - flex={1} - textAlign={['center', null, 'right']} - fontSize="1.5rem" - lineHeight={3} - bg={['red', null, 'unset']} - color="white" - > - <List - p={0} - css={` - text-transform: lowercase; - opacity: 0.8; - > * { - display: block; - } - `} - > - <ListItem>Grafikai tervezés</ListItem> - <ListItem>Web design</ListItem> - <ListItem>User experience</ListItem> - <ListItem>3D</ListItem> - </List> - </Container> - </Container> - </Section> - )} - </ThemeConsumer> -); - -export default AboutSection; diff --git a/src/components/ContactSection.tsx b/src/components/ContactSection.tsx deleted file mode 100644 index 95630011007241baaed589d3a2313a2926ecf525..0000000000000000000000000000000000000000 --- a/src/components/ContactSection.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { graphql, StaticQuery } from 'gatsby'; -import React from 'react'; -import { Heading, Link, Text } from 'rebass'; -import { Behance, FacebookSquare, Instagram } from 'styled-icons/fa-brands'; -import Container from './Container'; -import IconLink from './IconLink'; -import Paragraph from './Paragraph'; -import Section, { Props } from './Section'; - -const ContactSection = (props: Props) => ( - <Section {...props}> - <Container as={Text} textAlign="center"> - <Heading id="contact">Kapcsolat</Heading> - - <StaticQuery - query={graphql` - { - site { - siteMetadata { - email - siteBehanceURL - siteFacebookURL - siteInstagramURL - } - } - } - `} - render={data => ( - <> - <Text my={4} fontSize="2em"> - <IconLink - icon={FacebookSquare} - href={data.site.siteMetadata.siteFacebookURL} - title="Facebook" - /> - - <IconLink - icon={Instagram} - href={data.site.siteMetadata.siteInstagramURL} - title="Instagram" - mx={4} - /> - - <IconLink - icon={Behance} - href={data.site.siteMetadata.siteBehanceURL} - title="Behance" - /> - </Text> - - <Paragraph pb={2}> - Van egy projekted számunkra? - <br /> - Küldj egy e-mailt a{' '} - <Text - as={Link} - href={`mailto:${data.site.siteMetadata.email}`} - fontWeight="bold" - > - {data.site.siteMetadata.email} - </Text>{' '} - címre! - </Paragraph> - </> - )} - /> - </Container> - </Section> -); - -export default ContactSection; diff --git a/src/components/Container.tsx b/src/components/Container.tsx deleted file mode 100644 index 63090f4420980f001835b814ba38fd544cb06c9c..0000000000000000000000000000000000000000 --- a/src/components/Container.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import React from 'react'; -import { Box } from 'rebass'; -import { ThemeConsumer } from 'styled-components'; - -interface Props { - children: React.ReactNode; - [propName: string]: any; // TODO: Extend type of `Box` -} - -const Container = (props: Props) => ( - <ThemeConsumer> - {theme => ( - <Box - width="100%" - px={3} - {...props} - mx="auto" - css={` - @media (min-width: ${theme.breakpoints[1]}px) { - max-width: 84vw; - } - - @media (min-width: ${theme.breakpoints[3]}px) { - max-width: 68vw; - } - `} - /> - )} - </ThemeConsumer> -); - -export default Container; diff --git a/src/components/Course.tsx b/src/components/Course.tsx deleted file mode 100644 index 248ecda3b9fd20854220e08a1650434dd383837c..0000000000000000000000000000000000000000 --- a/src/components/Course.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import Img from 'gatsby-image'; -import React from 'react'; -import { Box, Flex, Text } from 'rebass'; - -interface Props { - course: { - aspectRatio: number; - src: string; - srcSet: string; - sizes: string; - originalImg: string; - name: string; - dates: { - date: string; - room: string; - start: string; - end: string; - }[]; - }; -} - -const Course = ({ course }: Props) => ( - <Box - as="li" - p="2" - flexDirection={['column', 'row']} - css=" - flex-basis: 50%; - " - > - <Box as={Flex} flexDirection={['column', null, 'row']}> - <Box - as={Img} - fluid={course} - title={course.name} - m={1} - alignSelf={['center', null, 'flex-start']} - css="width: 10rem; min-width: 100px; flex-shrink: 0; margin: 0;" - /> - <Box - as="div" - ml={[0, null, 3]} - css=" - flex-grow: 1; - text-align: center; - " - > - <Text - as="div" - css="font-weight: bold; font-size: 1.5rem; margin: 1rem 0;" - > - {course.name} - </Text> - {course.dates.map(date => ( - <Box - as="div" - css={` - color: inherit; - :hover { - color: ${({ theme }: any) => theme.colors.red}; - } - `} - > - <Box - as={Flex} - flexDirection={['column', 'row', 'column', 'row']} - css=" - flex-wrap: wrap; - justify-content: center; - " - > - <Text as="span" css="font-weight: bold;margin-right: 0.2rem;"> - {date.date} - </Text>{' '} - <Text as="span"> - {date.start}-{date.end} - </Text> - </Box> - <Box as="div" mb={2}> - <Text as="span">({date.room})</Text> - </Box> - </Box> - ))} - </Box> - </Box> - </Box> -); - -export default Course; diff --git a/src/components/CourseSection.tsx b/src/components/CourseSection.tsx deleted file mode 100644 index b05670bc870e89cb3adf2c92687f753b0b13b6bf..0000000000000000000000000000000000000000 --- a/src/components/CourseSection.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { graphql, StaticQuery } from 'gatsby'; -import React from 'react'; -import { Box, Heading, Link, Text } from 'rebass'; -import Container from './Container'; -import Section from './Section'; -import Course from './Course'; -import Paragraph from './Paragraph'; - -const CourseSection = () => { - return ( - <Section> - <Container as={Text} textAlign="center" mb={3}> - <Heading id="courses" mt={4} mb={4}> - Tanfolyamok - </Heading> - - <Paragraph css="font-size: 1.2rem;" mb={4}> - Jelentkezni az{' '} - <Text - as={Link} - href="https://schdesign.hu/tanfolyam" - fontWeight="bold" - > - schdesign.hu/tanfolyam - </Text>{' '} - google formon tudtok. - <br /> - Várunk mindenkit sok szeretettel. - </Paragraph> - - <Box - as="div" - css=" - display: flex; - flex-wrap: wrap; - list-style-type: none; - justify-content: center; - " - > - <StaticQuery - query={graphql` - { - allCoursesYaml { - edges { - node { - name - dates { - date - room - start - end - } - image { - id - childImageSharp { - fluid { - ...GatsbyImageSharpFluid - originalImg - } - } - } - } - } - } - } - `} - render={data => { - return data.allCoursesYaml.edges.map(({ node }: any) => ( - <Course - key={node.name} - course={{ - name: node.name, - dates: node.dates, - ...node.image.childImageSharp.fluid, - }} - /> - )); - }} - /> - </Box> - </Container> - </Section> - ); -}; - -export default CourseSection; diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx deleted file mode 100644 index 32388cd962cf4c39cd595b3b6d92556fff683b6d..0000000000000000000000000000000000000000 --- a/src/components/Footer.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { graphql, StaticQuery } from 'gatsby'; -import React from 'react'; -import { Box, Image, Link, Text } from 'rebass'; -import Container from './Container'; - -const Footer = () => ( - <Box as="footer" bg="darkgray" color="white"> - <Text as={Container} textAlign="center" pt={1} my={3}> - <StaticQuery - query={graphql` - { - allSponsorsYaml { - edges { - node { - id - name - website - logo { - publicURL - } - } - } - } - } - `} - render={data => - data.allSponsorsYaml.edges.map(({ node }: any, i: number) => ( - <Link - key={node.id} - href={node.website} - ml={i !== 0 ? [4, 5] : null} - css={` - :not(:hover) { - opacity: 0.75; - } - `} - > - <Image src={node.logo.publicURL} alt={node.name} height="3em" /> - </Link> - )) - } - /> - </Text> - </Box> -); - -export default Footer; diff --git a/src/components/Gallery.tsx b/src/components/Gallery.tsx deleted file mode 100644 index 1e728e5a7da274d4a503a60aadff2e224abb38b1..0000000000000000000000000000000000000000 --- a/src/components/Gallery.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import Img from 'gatsby-image'; -import React, { useState } from 'react'; -import Carousel, { Modal, ModalGateway } from 'react-images'; -import { Box, Link } from 'rebass'; -import { chunk, sum } from '../utils/array'; -import carouselFormatters from '../utils/carouselFormatters'; - -interface Props { - images: { - id: string; - aspectRatio: number; - src: string; - srcSet: string; - sizes: string; - originalImg: string; - caption: string; - }[]; - itemsPerRow?: number[]; -} - -const Gallery = ({ - images, - itemsPerRow: itemsPerRowByBreakpoints = [1], -}: Props) => { - const aspectRatios = images.map(image => image.aspectRatio); - const rowAspectRatioSumsByBreakpoints = itemsPerRowByBreakpoints.map( - itemsPerRow => - chunk(aspectRatios, itemsPerRow).map(rowAspectRatios => - sum(rowAspectRatios), - ), - ); - - const [modalIsOpen, setModalIsOpen] = useState(false); - const [modalCurrentIndex, setModalCurrentIndex] = useState(0); - - const closeModal = () => setModalIsOpen(false); - const openModal = (imageIndex: number) => { - setModalCurrentIndex(imageIndex); - setModalIsOpen(true); - }; - - return ( - <> - {images.map((image, i) => ( - <Link - key={image.id} - href={image.originalImg} - onClick={(e: React.MouseEvent<HTMLAnchorElement>) => { - e.preventDefault(); - openModal(i); - }} - > - <Box - as={Img} - fluid={image} - title={image.caption} - width={rowAspectRatioSumsByBreakpoints.map( - (rowAspectRatioSums, j) => { - const rowIndex = Math.floor(i / itemsPerRowByBreakpoints[j]); - const rowAspectRatioSum = rowAspectRatioSums[rowIndex]; - - return `${(image.aspectRatio / rowAspectRatioSum) * 100}%`; - }, - )} - css={` - display: inline-block; - vertical-align: middle; - transition: filter 0.3s; - :hover { - filter: brightness(87.5%); - } - `} - /> - </Link> - ))} - - {ModalGateway && ( - <ModalGateway> - {modalIsOpen && ( - <Modal onClose={closeModal}> - <Carousel - views={images.map(({ originalImg, caption }) => ({ - source: originalImg, - caption, - }))} - currentIndex={modalCurrentIndex} - formatters={carouselFormatters} - components={{ FooterCount: () => null }} - /> - </Modal> - )} - </ModalGateway> - )} - </> - ); -}; - -export default Gallery; diff --git a/src/components/Header.tsx b/src/components/Header.tsx deleted file mode 100644 index a3cceb60d2d2bbc2cde99372197aa849372accb6..0000000000000000000000000000000000000000 --- a/src/components/Header.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { graphql, Link as GatsbyLink, StaticQuery } from 'gatsby'; -import React from 'react'; -import { Box, Flex, Image } from 'rebass'; -import Container from './Container'; -import List from './List'; -import ListItem from './ListItem'; -import NavLink from './NavLink'; - -import schdesignLogoSrc from '../assets/schdesign-logo.svg'; - -const Header = () => ( - <Box as="header" bg="darkgray" color="white"> - <Flex - as={Container} - flexDirection={['column', 'row']} - justifyContent="space-between" - alignItems="center" - my={2} - > - <GatsbyLink to="/"> - <Image - src={schdesignLogoSrc} - alt="schdesign" - height="2em" - my={2} - css="display: block;" - /> - </GatsbyLink> - - <Box as="nav" my={2}> - <List p={0} m={0}> - <StaticQuery - query={graphql` - { - allHeaderMenuItemsYaml { - edges { - node { - id - title - url - } - } - } - } - `} - render={data => - data.allHeaderMenuItemsYaml.edges.map( - ({ node }: any, i: number) => ( - <ListItem - key={node.id} - m={-2} - ml={i !== 0 ? [4, 5] : null} - css="display: inline-block;" - > - <NavLink as={GatsbyLink} to={node.url} p={2}> - {node.title} - </NavLink> - </ListItem> - ), - ) - } - /> - </List> - </Box> - </Flex> - </Box> -); - -export default Header; diff --git a/src/components/IconLink.tsx b/src/components/IconLink.tsx deleted file mode 100644 index 419b7be821a901ab458585a57e60f168ca236ced..0000000000000000000000000000000000000000 --- a/src/components/IconLink.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { Box } from 'rebass'; -import { StyledIcon } from 'styled-icons/types'; - -interface Props { - icon: StyledIcon; - href?: string; - title?: string; - [propName: string]: any; // TODO: Extend type of `Box` -} - -const IconLink = ({ icon: Icon, title, ...props }: Props) => ( - <Box - as="a" - {...props} - css={` - color: inherit; - :hover { - color: ${({ theme }: any) => theme.colors.red}; - } - `} - > - <Icon title={title} size="1em" /> - </Box> -); - -export default IconLink; diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx deleted file mode 100644 index aed607a158da5f6cfe87cb619cd01f6934a5ffec..0000000000000000000000000000000000000000 --- a/src/components/Layout.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { graphql, StaticQuery } from 'gatsby'; -import React from 'react'; -import { Helmet } from 'react-helmet-async'; -import { Box, Flex } from 'rebass'; -import smoothscroll from 'smoothscroll-polyfill'; -import { createGlobalStyle, ThemeProvider } from 'styled-components'; -import defaultTheme from '../utils/theme'; -import Footer from './Footer'; -import Header from './Header'; - -if (typeof window !== 'undefined') { - smoothscroll.polyfill(); -} - -const GlobalStyle = createGlobalStyle` - html { - color: ${({ theme }: any) => theme.colors.darkgray}; - font-family: ${({ theme }: any) => theme.fonts.sans}; - scroll-behavior: smooth; - - @media (min-width: ${({ theme }: any) => theme.breakpoints[1]}px) { - font-size: 125%; - } - - @media (min-width: ${({ theme }: any) => theme.breakpoints[3]}px) { - font-size: 150%; - } - } - - body { - margin: 0; - - /* Prevent adjustments of font size after orientation changes in iOS */ - text-size-adjust: 100%; - } - - p { - line-height: 1.5; - } -`; - -interface Props { - children: React.ReactNode; -} - -const Layout = ({ children }: Props) => ( - <ThemeProvider theme={defaultTheme}> - <Flex flexDirection="column" css="min-height: 100vh;"> - <GlobalStyle /> - - <StaticQuery - query={graphql` - { - site { - siteMetadata { - title - description - language - } - } - } - `} - render={data => ( - <Helmet - titleTemplate={`%s | ${data.site.siteMetadata.title}`} - defaultTitle={data.site.siteMetadata.title} - > - <html lang={data.site.siteMetadata.language} /> - <meta - name="description" - content={data.site.siteMetadata.description} - /> - - <link - href="https://fonts.googleapis.com/css?family=Montserrat:400,600|Roboto+Mono:500" - rel="stylesheet" - /> - </Helmet> - )} - /> - - <Header /> - - <Box as="main" flex={1}> - {children} - </Box> - - <Footer /> - </Flex> - </ThemeProvider> -); - -export default Layout; diff --git a/src/components/List.tsx b/src/components/List.tsx deleted file mode 100644 index a9f39544b34c0266345942dd9b0243bb9eaf9739..0000000000000000000000000000000000000000 --- a/src/components/List.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { Box } from 'rebass'; - -interface Props { - children: React.ReactNode; - as?: 'ul' | 'ol'; - [propName: string]: any; // TODO: Extend type of `Box` -} - -const List = (props: Props) => <Box as="ul" {...props} />; - -export default List; diff --git a/src/components/ListItem.tsx b/src/components/ListItem.tsx deleted file mode 100644 index 531be51e490fb9f6b94b8d2517b549dd250dc8c2..0000000000000000000000000000000000000000 --- a/src/components/ListItem.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import { Box } from 'rebass'; - -interface Props { - children: React.ReactNode; - [propName: string]: any; // TODO: Extend type of `Box` -} - -const ListItem = (props: Props) => <Box as="li" {...props} />; - -export default ListItem; diff --git a/src/components/NavLink.tsx b/src/components/NavLink.tsx deleted file mode 100644 index 59c30fc933e559a3e4be23e4f7f5ff1dd730a1d7..0000000000000000000000000000000000000000 --- a/src/components/NavLink.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import { Box } from 'rebass'; - -interface Props { - children: React.ReactNode; - to: string; - [propName: string]: any; // TODO: Extend type of `Box` -} - -const NavLink = ({ to, ...props }: Props) => ( - <Box - as="a" - color="inherit" - to={to} - {...props} - onClick={(e: React.MouseEvent<HTMLAnchorElement>) => { - const elementID = to.split('#')[1]; - const element = document.getElementById(elementID); - - if (element) { - e.preventDefault(); - element.scrollIntoView({ behavior: 'smooth', block: 'start' }); - } - }} - css={` - text-decoration: none; - text-transform: lowercase; - :not(:hover) { - opacity: 0.75; - } - `} - /> -); - -export default NavLink; diff --git a/src/components/Paragraph.tsx b/src/components/Paragraph.tsx deleted file mode 100644 index a1aca01dca5ef48a1b007eb43a0a0be2a846a93e..0000000000000000000000000000000000000000 --- a/src/components/Paragraph.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import { Text } from 'rebass'; - -interface Props { - [propName: string]: any; // TODO: Extend type of `Text` -} - -const Paragraph = (props: Props) => <Text as="p" lineHeight={1.5} {...props} />; - -export default Paragraph; diff --git a/src/components/Section.tsx b/src/components/Section.tsx deleted file mode 100644 index 4aa0c927bb661a60b2681127f5ea4f214db7b548..0000000000000000000000000000000000000000 --- a/src/components/Section.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import { Box } from 'rebass'; - -export interface Props { - variant?: 'light' | 'dark'; - [propName: string]: any; // TODO: Extend type of `Box` -} - -const Section = ({ variant, ...props }: Props) => ( - <Box - as="section" - {...variant === 'dark' && { bg: 'darkgray', color: 'white' }} - {...props} - /> -); - -export default Section; diff --git a/src/components/TextLink.tsx b/src/components/TextLink.tsx deleted file mode 100644 index 4b8f10f701d74305f176fe3ebb50cd6847ed2902..0000000000000000000000000000000000000000 --- a/src/components/TextLink.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { Box } from 'rebass'; - -interface Props { - children: React.ReactNode; - onClick: () => void; - [propName: string]: any; // TODO: Extend type of `Box` -} - -const TextLink = ({ onClick, ...props }: Props) => ( - <Box - as="span" - onClick={onClick} - {...props} - css={` - color: #f8485e; - font-weight: bold; - text-transform: lowercase; - cursor: pointer; - :not(:hover) { - opacity: 0.75; - } - `} - /> -); - -export default TextLink; diff --git a/src/components/WorksSection.tsx b/src/components/WorksSection.tsx deleted file mode 100644 index 59022338aa56ab65b87bbaf20f5770d852e3942a..0000000000000000000000000000000000000000 --- a/src/components/WorksSection.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import { graphql, StaticQuery } from 'gatsby'; -import React from 'react'; -import { Heading } from 'rebass'; -import Gallery from './Gallery'; -import Section, { Props } from './Section'; - -const WorksSection = (props: Props) => ( - <Section {...props}> - <Heading id="works" textAlign="center" py={4}> - Munkáink - </Heading> - - <StaticQuery - query={graphql` - { - allWorksYaml { - edges { - node { - title - author - image { - id - childImageSharp { - fluid { - ...GatsbyImageSharpFluid - originalImg - } - } - } - } - } - } - } - `} - render={data => ( - <Gallery - images={data.allWorksYaml.edges.map(({ node }: any) => ({ - id: node.image.id, - ...node.image.childImageSharp.fluid, - caption: `${node.title} – ${node.author}`, - }))} - itemsPerRow={[1, 2, 3]} - /> - )} - /> - </Section> -); - -export default WorksSection; diff --git a/src/declarations.d.ts b/src/declarations.d.ts index a9b186de7ce74fd4a6a05593dce406ae1e3b61eb..23d8370716cc702ec6d57ece47a51019756211cc 100644 --- a/src/declarations.d.ts +++ b/src/declarations.d.ts @@ -8,5 +8,3 @@ // declare module '*.png'; declare module '*.svg'; -declare module 'react-images'; // TODO: Remove when typings for v1 are available -declare module 'rebass'; // TODO: Remove when the type declarations are fixed diff --git a/src/pages/404.tsx b/src/pages/404.tsx deleted file mode 100644 index ecb85106c4ffa397cf3fbe580a3a924a45bf1170..0000000000000000000000000000000000000000 --- a/src/pages/404.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import { Helmet } from 'react-helmet-async'; -import { Heading } from 'rebass'; -import Container from '../components/Container'; -import Layout from '../components/Layout'; -import Paragraph from '../components/Paragraph'; - -const NotFoundPage = () => ( - <Layout> - <Container> - <Helmet> - <title>404</title> - </Helmet> - - <Heading mt={3}>404</Heading> - <Paragraph>A keresett oldal nem található.</Paragraph> - </Container> - </Layout> -); - -export default NotFoundPage; diff --git a/src/pages/index.tsx b/src/pages/index.tsx deleted file mode 100644 index 03fb31b5b72abfa8cd140df24e52552144d3dc41..0000000000000000000000000000000000000000 --- a/src/pages/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import AboutSection from '../components/AboutSection'; -import CourseSection from '../components/CourseSection'; -import ContactSection from '../components/ContactSection'; -import Layout from '../components/Layout'; -import WorksSection from '../components/WorksSection'; - -const IndexPage = () => ( - <Layout> - <AboutSection /> - {/* Uncomment to add courses, edit in data/courses.yml */} - {/* <CourseSection /> */} - <WorksSection variant="dark" /> - <ContactSection my={[4, 5]} /> - </Layout> -); - -export default IndexPage; diff --git a/tsconfig.json b/tsconfig.json index 49f3de85ad49717fd571a90a4a6252a198dc7ca4..d8eadcb42f3ceac84740f8c988ab1d01b83f245f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ // Reference: https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/ "compilerOptions": { "strict": true, - "target": "esnext", + "target": "ESNext", "moduleResolution": "node", "jsx": "react", "allowJs": true,