| #!/usr/bin/env sh | #!/usr/bin/env sh | ||||
| . "$(dirname -- "$0")/_/husky.sh" | . "$(dirname -- "$0")/_/husky.sh" | ||||
| #yarn build | |||||
| yarn build |
| import { Divider, Paper, Typography } from '@mui/material'; | import { Divider, Paper, Typography } from '@mui/material'; | ||||
| import PropType from 'prop-types'; | |||||
| const DataCard = ({ data, t }) => { | const DataCard = ({ data, t }) => { | ||||
| return ( | return ( | ||||
| ); | ); | ||||
| }; | }; | ||||
| DataCard.propTypes = { | |||||
| data: PropType.shape({ | |||||
| name: PropType.string, | |||||
| age: PropType.number, | |||||
| gender: PropType.string, | |||||
| }), | |||||
| t: PropType.func, | |||||
| }; | |||||
| export default DataCard; | export default DataCard; |
| import CardContent from '@mui/material/CardContent'; | import CardContent from '@mui/material/CardContent'; | ||||
| import Typography from '@mui/material/Typography'; | import Typography from '@mui/material/Typography'; | ||||
| import Image from 'next/image'; | import Image from 'next/image'; | ||||
| import PropType from 'prop-types'; | |||||
| const DataDetailsCard = ({ data }) => { | const DataDetailsCard = ({ data }) => { | ||||
| return ( | return ( | ||||
| ); | ); | ||||
| }; | }; | ||||
| DataDetailsCard.propTypes = { | |||||
| data: PropType.shape({ | |||||
| name: PropType.string, | |||||
| gender: PropType.string, | |||||
| }), | |||||
| }; | |||||
| export default DataDetailsCard; | export default DataDetailsCard; |
| const base = {}; | |||||
| export const mockHoverImageCardProps = { | |||||
| base, | |||||
| }; |
| import HoverImageCard from './HoverImageCard'; | |||||
| import { mockHoverImageCardProps } from './ProfileCard.mock'; | |||||
| const obj = { | |||||
| title: 'cards/HoverImageCard', | |||||
| component: HoverImageCard, | |||||
| // More on argTypes: https://storybook.js.org/docs/react/api/argtypes | |||||
| argTypes: {}, | |||||
| }; //eslint-disable-line | |||||
| export default obj; | |||||
| // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args | |||||
| const Template = (args) => <HoverImageCard {...args} />; | |||||
| export const Base = Template.bind({}); | |||||
| // More on args: https://storybook.js.org/docs/react/writing-stories/args | |||||
| Base.args = { | |||||
| ...mockHoverImageCardProps.base, | |||||
| }; |
| import CardContent from '@mui/material/CardContent'; | import CardContent from '@mui/material/CardContent'; | ||||
| import Typography from '@mui/material/Typography'; | import Typography from '@mui/material/Typography'; | ||||
| import Image from 'next/image'; | import Image from 'next/image'; | ||||
| import PropType from 'prop-types'; | |||||
| const ProfileCard = ({ profileData }) => { | const ProfileCard = ({ profileData }) => { | ||||
| return ( | return ( | ||||
| ); | ); | ||||
| }; | }; | ||||
| ProfileCard.propTypes = { | |||||
| profileData: PropType.shape({ | |||||
| name: PropType.string, | |||||
| }), | |||||
| }; | |||||
| export default ProfileCard; | export default ProfileCard; |
| const base = {}; | |||||
| export const mockContactFormProps = { | |||||
| base, | |||||
| }; |
| import ContactForm from './ContactForm'; | |||||
| import { mockContactFormProps } from './ContactForm.mock'; | |||||
| const obj = { | |||||
| title: 'forms/ContactForm', | |||||
| component: ContactForm, | |||||
| // More on argTypes: https://storybook.js.org/docs/react/api/argtypes | |||||
| argTypes: {}, | |||||
| }; //eslint-disable-line | |||||
| export default obj; | |||||
| // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args | |||||
| const Template = (args) => <ContactForm {...args} />; | |||||
| export const Base = Template.bind({}); | |||||
| // More on args: https://storybook.js.org/docs/react/writing-stories/args | |||||
| Base.args = { | |||||
| ...mockContactFormProps.base, | |||||
| }; |
| Select, | Select, | ||||
| TextField, | TextField, | ||||
| } from '@mui/material'; | } from '@mui/material'; | ||||
| import PropType from 'prop-types'; | |||||
| const FilterSortComponent = ({ | const FilterSortComponent = ({ | ||||
| sort, | sort, | ||||
| ); | ); | ||||
| }; | }; | ||||
| FilterSortComponent.propTypes = { | |||||
| sort: PropType.string, | |||||
| handleSortChange: PropType.func, | |||||
| filter: PropType.string, | |||||
| handleFilterChange: PropType.func, | |||||
| }; | |||||
| export default FilterSortComponent; | export default FilterSortComponent; |
| import React from 'react'; | |||||
| import PropTypes from 'prop-types'; | import PropTypes from 'prop-types'; | ||||
| import React from 'react'; | |||||
| import BaseInputField from './BaseInputField'; | import BaseInputField from './BaseInputField'; | ||||
| }) => ( | }) => ( | ||||
| <BaseInputField | <BaseInputField | ||||
| type="text" | type="text" | ||||
| label="" | |||||
| label={label} | |||||
| placeholder={placeholder} | placeholder={placeholder} | ||||
| disabled={disabled} | disabled={disabled} | ||||
| form={form} | form={form} |
| const person = await Person.findOne({ customID: dataId }); | const person = await Person.findOne({ customID: dataId }); | ||||
| console.log(person); | |||||
| if (!person) { | if (!person) { | ||||
| throw new Error('Person with this id does not exist!'); | throw new Error('Person with this id does not exist!'); | ||||
| } | } |
| import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; | import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; | ||||
| import ContactForm from '../components/forms/contact/ContactForm'; | |||||
| import ContactForm from '../../components/forms/contact/ContactForm'; | |||||
| const ContactPage = () => { | const ContactPage = () => { | ||||
| return <ContactForm />; | return <ContactForm />; |
| import { dehydrate, QueryClient } from '@tanstack/react-query'; | import { dehydrate, QueryClient } from '@tanstack/react-query'; | ||||
| import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; | import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; | ||||
| import Head from 'next/head'; | import Head from 'next/head'; | ||||
| import HoverImageCard from '../components/cards/hover-image-card/hover-image-card'; | |||||
| import HoverImageCard from '../components/cards/hover-image-card/HoverImageCard'; | |||||
| import PaginationComponentRQ from '../components/pagination/react-query/PaginationComponentRQ'; | import PaginationComponentRQ from '../components/pagination/react-query/PaginationComponentRQ'; | ||||
| import { getData } from '../requests/dataRequest'; | import { getData } from '../requests/dataRequest'; | ||||
| const SignelDataPage = (props) => { | const SignelDataPage = (props) => { | ||||
| const data = props.selectedData; | const data = props.selectedData; | ||||
| console.log(data); | |||||
| if (!data) { | if (!data) { | ||||
| return <h1>{props.message}</h1>; | return <h1>{props.message}</h1>; | ||||
| } | } | ||||
| } | } | ||||
| export async function getStaticPaths() { | export async function getStaticPaths() { | ||||
| const firstPageDataIds = await getDataIds(); | |||||
| console.log(firstPageDataIds); | |||||
| const paths = firstPageDataIds.dataIds.map((id) => ({ | |||||
| params: { dataId: id }, | |||||
| })); | |||||
| try { | |||||
| const firstPageDataIds = await getDataIds(); | |||||
| const paths = firstPageDataIds.dataIds.map((id) => ({ | |||||
| params: { dataId: id }, | |||||
| })); | |||||
| console.log(paths); | |||||
| return { | |||||
| paths: paths, | |||||
| fallback: 'blocking', | |||||
| }; | |||||
| return { | |||||
| paths: paths, | |||||
| fallback: 'blocking', | |||||
| }; | |||||
| } catch (error) { | |||||
| return { | |||||
| paths: [], | |||||
| fallback: 'blocking', | |||||
| }; | |||||
| } | |||||
| } | } | ||||
| export default SignelDataPage; | export default SignelDataPage; |