Skip to content

Commit

Permalink
chore: edit readme, add deploy.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bo cheng committed Nov 14, 2021
1 parent 707d516 commit cd4e7ca
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 48 deletions.
58 changes: 18 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 6 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -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
Binary file added public/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions src/components/ActivityCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ function ActivityCard({ name, location, imageUrl, description, address, websiteU
<ActivityCardWrapper>
<ShadowEffectCard>
<ContentWrapper>
<ActivityImage backgoundUrl={imageUrl} />
<ActivityImage backgoundUrl={imageUrl} onClick={() => {
if (onClick) {
onClick()
}
}}/>
<ActivityInformation>
{websiteUrl ? (
<ActivityLinkTitle href={websiteUrl} lineLimit={1} target="_blank">{name}</ActivityLinkTitle>
Expand All @@ -38,7 +42,7 @@ function ActivityCard({ name, location, imageUrl, description, address, websiteU
{description && <ActivityDescription lineLimit={6}>{description}</ActivityDescription>}
<ActivityRow>
{location && address && <LocationLink location={location} address={address} />}
<DetailButton onClick={() => {
<DetailButton onClick={e => {
if (onClick) {
onClick()
}
Expand Down
1 change: 1 addition & 0 deletions src/components/ActivityCard/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export const ActivityImage = styled.div.attrs<ActivityImageProps>(props => ({
background-size: contain;
background-repeat: no-repeat;
margin-right: 16px;
cursor: pointer;
${breakpoint('lg')`
width: 187px;
Expand Down
6 changes: 1 addition & 5 deletions src/components/Lightbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -53,13 +51,11 @@ function Lightbox({ onClose, item }: { onClose: () => void, item: Item }) {

return (
<LightBoxWrapper>
<LightBoxContentWrapper onClick={e => {
e.stopPropagation()
<LightBoxContentWrapper onClick={() => {
onClose()
}}>
<LightBoxContent onClick={e => {
e.stopPropagation()
console.log('LightBoxContent')
}}>
<LightBoxImageWrapper>
<LightBoxImage src={pictures[imageIndex]} onError={e => {
Expand Down
2 changes: 1 addition & 1 deletion src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cd4e7ca

Please sign in to comment.