-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from yungshenglu/develop
add: List title and bug fixing
- Loading branch information
Showing
32 changed files
with
218 additions
and
283 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 +1,7 @@ | ||
import React from 'react'; | ||
import Router from './router'; | ||
|
||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
|
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,10 +1,11 @@ | ||
import PropTypes from 'prop-types'; | ||
import { AAvatar } from '@P/antd'; | ||
|
||
|
||
export function AntAvatar({ ...props }: any) { | ||
return <AAvatar {...props} />; | ||
} | ||
|
||
AntAvatar.prototype = { | ||
props: PropTypes.object | ||
} | ||
}; |
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,10 +1,11 @@ | ||
import PropTypes from 'prop-types'; | ||
import { StyledAntBacktop } from './style'; | ||
|
||
|
||
export function AntBacktop({ ...props }: any) { | ||
return <StyledAntBacktop {...props} />; | ||
} | ||
|
||
AntBacktop.prototype = { | ||
props: PropTypes.object | ||
} | ||
}; |
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,10 +1,11 @@ | ||
import PropTypes from 'prop-types'; | ||
import { ABadge } from '@P/antd'; | ||
|
||
|
||
export function AntBadge({ ...props }: any) { | ||
return <ABadge {...props} />; | ||
} | ||
|
||
AntBadge.prototype = { | ||
props: PropTypes.object | ||
} | ||
}; |
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,6 +1,7 @@ | ||
import styled from 'styled-components'; | ||
import { AEmpty } from '@P/antd'; | ||
|
||
|
||
export const StyledEmpty = styled(AEmpty)` | ||
color: #000; | ||
`; |
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
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,53 +1,17 @@ | ||
import { useState, useEffect } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import AntNotification from '@C/AntNotification'; | ||
import CusPostModal from '@C/CusPostModal'; | ||
import useFetchPost from '@H/useFetchPost'; | ||
import { StyledItemTitle } from './style'; | ||
|
||
|
||
export function CusItemTitle({ content, id }: any) { | ||
const [modalVisible, setModalVisible] = useState(false); | ||
const [{ data, isLoading, isError }, refetch]: any = useFetchPost(id); | ||
|
||
useEffect(() => { | ||
if (isError) { | ||
AntNotification({ | ||
message: '系統錯誤', | ||
description: '目前連線異常,請稍後再試。' | ||
}); | ||
} | ||
}, [isError]); | ||
|
||
// Event handler | ||
const handleOpenModal = async () => { | ||
setModalVisible(true); | ||
await refetch(); | ||
} | ||
|
||
const handleCloseModal = () => { | ||
setModalVisible(false); | ||
} | ||
|
||
export function CusItemTitle({ content, itemId }: any) { | ||
// Render | ||
return ( | ||
<> | ||
<StyledItemTitle onClick={handleOpenModal} margin> | ||
{ content } | ||
</StyledItemTitle> | ||
<CusPostModal | ||
modalTitle={content} | ||
modalData={data} | ||
isLoading={isLoading} | ||
isError={isError} | ||
modalVisible={modalVisible} | ||
onCloseModal={handleCloseModal} | ||
/> | ||
</> | ||
<StyledItemTitle margin> | ||
{ content } | ||
</StyledItemTitle> | ||
); | ||
}; | ||
|
||
CusItemTitle.prototype = { | ||
content: PropTypes.string, | ||
id: PropTypes.number | ||
itemId: PropTypes.number | ||
}; |
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
Oops, something went wrong.