diff --git a/README.md b/README.md index b58e0af..06b5710 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,24 @@ -# Getting Started with Create React App +# Taiwan Tourist Attractions Website -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). +![screenshot](https://jason71708.github.io/F2E2021-taiwan-tourist-attractions/screenshot.png) +## Features +- Search Taiwan scenic spots, hotels, restaurants, activities. +- Mobile friendly. +- Use keywords, city, category to filter. -## Available Scripts +## Built with -In the project directory, you can run: +- [React](https://reactjs.org/) +- [Styled Components](https://styled-components.com/) +- [React-Saga](https://redux-saga.js.org/) +- [React-Router](https://reactrouter.com/) +- [TypeScript](https://www.typescriptlang.org/) +- And other useful plugins -### `yarn start` +## API resource +[Taiwan Transport Data eXchange Service: TDX](https://tdx.transportdata.tw/api-service/swagger) -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. -The page will reload if you make edits.\ -You will also see any lint errors in the console. - -### `yarn test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `yarn build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `yarn eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). +## Authors +- Website - [傑森莊 Jason Zhuang](https://github.com/jason71708) +- UI design - [KT](https://www.behance.net/KT_Designer) \ No newline at end of file diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..ad810f6 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,6 @@ +#!bash + +yarn build +# For github page use, in order to redirect to spa route +cp ./build/index.html ./build/404.html +yarn deploy \ No newline at end of file diff --git a/public/screenshot.png b/public/screenshot.png new file mode 100644 index 0000000..33245dd Binary files /dev/null and b/public/screenshot.png differ diff --git a/src/components/ActivityCard/index.tsx b/src/components/ActivityCard/index.tsx index aacd4ce..d72e59a 100644 --- a/src/components/ActivityCard/index.tsx +++ b/src/components/ActivityCard/index.tsx @@ -28,7 +28,11 @@ function ActivityCard({ name, location, imageUrl, description, address, websiteU - + { + if (onClick) { + onClick() + } + }}/> {websiteUrl ? ( {name} @@ -38,7 +42,7 @@ function ActivityCard({ name, location, imageUrl, description, address, websiteU {description && {description}} {location && address && } - { + { if (onClick) { onClick() } diff --git a/src/components/ActivityCard/style.ts b/src/components/ActivityCard/style.ts index ff867f4..2d10e56 100644 --- a/src/components/ActivityCard/style.ts +++ b/src/components/ActivityCard/style.ts @@ -119,6 +119,7 @@ export const ActivityImage = styled.div.attrs(props => ({ background-size: contain; background-repeat: no-repeat; margin-right: 16px; + cursor: pointer; ${breakpoint('lg')` width: 187px; diff --git a/src/components/Lightbox/index.tsx b/src/components/Lightbox/index.tsx index cf174bc..845fcd8 100644 --- a/src/components/Lightbox/index.tsx +++ b/src/components/Lightbox/index.tsx @@ -42,8 +42,6 @@ function Lightbox({ onClose, item }: { onClose: () => void, item: Item }) { const [imageIndex, setImageIndex] = useState(0) const pictures = formatPictures(item.Picture) - console.log(item) - useEffect(() => { document.body.style.overflow = 'hidden' return () => { @@ -53,13 +51,11 @@ function Lightbox({ onClose, item }: { onClose: () => void, item: Item }) { return ( - { - e.stopPropagation() + { onClose() }}> { e.stopPropagation() - console.log('LightBoxContent') }}> { diff --git a/src/constants/index.ts b/src/constants/index.ts index d612a46..e69367b 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -116,7 +116,7 @@ export enum Shapes { } export const generateStaticImagePath = (name: string, type: string) => { - return (process.env.NODE_ENV === 'production' ? process.env.REACT_APP_GITHUB_PAGE_PATH : '') + `/images/${name}.${type}` + return `${process.env.REACT_APP_GITHUB_PAGE_PATH}/images/${name}.${type}` } export enum ScrollTargetNames {