-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Move mockData to the API directory and implement Redux integration…
… with the API
- Loading branch information
1 parent
bc93ce4
commit dfba0ec
Showing
15 changed files
with
999 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useDispatch, useSelector } from 'react-redux'; | ||
import { Box, Button } from '@mui/material'; | ||
import { setLimit } from '@/redux/actions/group'; | ||
|
||
export default function More() { | ||
const dispatch = useDispatch(); | ||
const { limit, total, isLoading } = useSelector((state) => state.group); | ||
const isMore = total > limit || isLoading; | ||
|
||
return ( | ||
<Box | ||
sx={{ textAlign: 'center', paddingTop: '80px', paddingBottom: '100px' }} | ||
> | ||
{isMore ? ( | ||
<Button | ||
variant="outlined" | ||
sx={{ | ||
fontSize: '16px', | ||
color: '#536166', | ||
borderColor: '#16B9B3', | ||
borderRadius: '20px', | ||
padding: '6px 48px', | ||
}} | ||
onClick={() => dispatch(setLimit(limit + 12))} | ||
> | ||
顯示更多 | ||
</Button> | ||
) : ( | ||
'已經到底囉~' | ||
)} | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
export const AREAS = [ | ||
{ name: '線上' }, | ||
{ name: '臺北市' }, | ||
{ name: '新北市' }, | ||
{ name: '基隆市' }, | ||
{ name: '桃園市' }, | ||
{ name: '新竹市' }, | ||
{ name: '新竹縣' }, | ||
{ name: '苗栗縣' }, | ||
{ name: '臺中市' }, | ||
{ name: '南投縣' }, | ||
{ name: '彰化縣' }, | ||
{ name: '雲林縣' }, | ||
{ name: '嘉義市' }, | ||
{ name: '嘉義縣' }, | ||
{ name: '臺南市' }, | ||
{ name: '高雄市' }, | ||
{ name: '屏東縣' }, | ||
{ name: '臺東縣' }, | ||
{ name: '花蓮縣' }, | ||
{ name: '宜蘭縣' }, | ||
{ name: '澎湖縣' }, | ||
{ name: '金門縣' }, | ||
{ name: '連江縣' }, | ||
{ name: '線上', label: '線上' }, | ||
{ name: '台北市', label: '台北市' }, | ||
{ name: '新北市', label: '新北市' }, | ||
{ name: '基隆市', label: '基隆市' }, | ||
{ name: '桃園市', label: '桃園市' }, | ||
{ name: '新竹市', label: '新竹市' }, | ||
{ name: '新竹縣', label: '新竹縣' }, | ||
{ name: '苗栗縣', label: '苗栗縣' }, | ||
{ name: '台中市', label: '台中市' }, | ||
{ name: '南投縣', label: '南投縣' }, | ||
{ name: '彰化縣', label: '彰化縣' }, | ||
{ name: '雲林縣', label: '雲林縣' }, | ||
{ name: '嘉義市', label: '嘉義市' }, | ||
{ name: '嘉義縣', label: '嘉義縣' }, | ||
{ name: '台南市', label: '台南市' }, | ||
{ name: '高雄市', label: '高雄市' }, | ||
{ name: '屏東縣', label: '屏東縣' }, | ||
{ name: '台東縣', label: '台東縣' }, | ||
{ name: '花蓮縣', label: '花蓮縣' }, | ||
{ name: '宜蘭縣', label: '宜蘭縣' }, | ||
{ name: '澎湖縣', label: '澎湖縣' }, | ||
{ name: '金門縣', label: '金門縣' }, | ||
{ name: '連江縣', label: '連江縣' }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.