-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add BackstagePage #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
大部分是命名的問題~
src/components/App.js
Outdated
<Route exact path="/add"> | ||
<AddPage /> | ||
</Route> | ||
<Route exact path="/form"> | ||
<FormPage /> | ||
</Route> | ||
<Route exact path="/backstage"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
跟我的路由撞名ㄌ,開會討論怎麼改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
待討論:
- 前台是單支留言 => /issue/奇怪的url
- 後台 => /backstage
- 後台總留言 => /backstage/issues
- 後台單支留言 => /backstage/issue or /backstage/issue/奇怪的url
justify-self: center; | ||
` | ||
|
||
const EditWrapper = styled.form` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這個名子可能要含有 form 比較知道原來他是個 form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
他不是 form 了 XD
` | ||
|
||
const EditSection = () => { | ||
const { secondary_300: secondary300 } = useTheme() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只解構要用的,讚
const randomN = (num) => { | ||
return Math.round(Math.random() * num) | ||
} | ||
const datas = () => { | ||
const jsonData = [] | ||
for (const i in Array(5).fill(0)) { | ||
jsonData.push({ | ||
date: '10/1' + i, | ||
views: randomN(100 + i * 10), | ||
comments: randomN(30 - i), | ||
replies: randomN(10) | ||
}) | ||
} | ||
return jsonData | ||
} | ||
const data = datas() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
雖然是測試用的假資料,但是命名感覺還是可以符合語意一點 XD
|
||
// TODO: get real data | ||
|
||
const handleClick = async (filter) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名感覺可以改成實際做了什麼事
<Button onClick={() => handleClick('all')} active={filter === 'all'}> | ||
<span>all</span> | ||
<span>data</span> | ||
</Button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這四個 button 感覺有優化的空間
<Legend /> | ||
{(filter === 'all' || filter === 'views') && ( | ||
<Line | ||
type="monotone" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這個 'monotone'
要存成常數嗎
const handleCopyQRcode = () => { | ||
navigator.clipboard.writeText(QRcodeImage).then( | ||
() => { | ||
alert('複製成功!') | ||
}, | ||
() => { | ||
alert('複製失敗 QQ') | ||
} | ||
) | ||
} | ||
|
||
const handleCopyURL = () => { | ||
navigator.clipboard.writeText(URL).then( | ||
() => { | ||
alert('複製成功!') | ||
}, | ||
() => { | ||
alert('複製失敗 QQ') | ||
} | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以寫成一個 function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哭哭再別的 branch = =
justify-self: center; | ||
` | ||
|
||
export default Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這個檔案是不是用不到了?
const SectionWrapper = styled.div` | ||
width: 100%; | ||
${({ isGreyBackground }) => isGreyBackground && 'background: #f9f9f9;'} | ||
` | ||
// background: ${({ theme }) => theme.secondary_850}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theme 跟註解
然後我找不到什麼時候會用到 isGreyBackground XD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EditSection 跟 GraphSection 有用到,他有傳 props
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但是我看不到灰背景,我眼鏡業障重嗎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
真的業障重
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
每個 section margin 在大一點 QQ,呼吸呼吸
src/components/BackstageNavbar.js
Outdated
{iconName('1x', theme.secondary_200)} | ||
<span>{title}</span> | ||
</div> | ||
{location.pathname === '/backstage' && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一樣 url 待討論
src/components/Button.js
Outdated
font-size: 1rem; | ||
text-align: center; | ||
line-height: ${BUTTON_HEIGHT}; | ||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在 menu 看不出來,放到 navbar 後,button 超大個...
userId={1} | ||
nickname="benben bunbun" | ||
MenuContent={BackstageMenuContent} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
討論:哪邊 call getMe API
const EditContent = styled.p` | ||
overflow: hidden; | ||
white-space: pre-line; | ||
text-overflow: ellipsis; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我直接 break all,hhhh... 真得超醜拉
) | ||
} | ||
|
||
export default EditSection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
再補上編輯功能,感恩的心
) | ||
} | ||
|
||
export default GraphSection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
` | ||
|
||
const QRcodeSection = () => { | ||
const QRcodeImage = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qrcode.react 可以研究一下這個套件
</QRcodeImageWrapper> | ||
<CopyWrapper onClick={handleCopyQRcode}>按此複製 QR code</CopyWrapper> | ||
<URLWrapper>{URL}</URLWrapper> | ||
<CopyWrapper onClick={handleCopyURL}>按此複製網址</CopyWrapper> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rockyooooooo 按此回頂端的樣式用這個好了,比較好看!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
玩了一下 CSS 因為原本背景有點空 wwww
const SectionWrapper = styled.div` | ||
width: 100%; | ||
${({ isGreyBackground }) => isGreyBackground && 'background: #f9f9f9;'} | ||
` | ||
// background: ${({ theme }) => theme.secondary_850}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EditSection 跟 GraphSection 有用到,他有傳 props
src/pages/HomePage/SurveySection.js
Outdated
<TitleWrapperRight> | ||
<h3>問卷調查</h3> | ||
<p>按您的喜好設計並創建表單,</p> | ||
<p>可快速搜集與整理觀眾的資料。</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
homepage 的 h3, p 用 cardList 寫好的資料套進去
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有一些之前說的沒改到 ><
src/components/Button.js
Outdated
@@ -4,6 +4,7 @@ export const BUTTON_HEIGHT = '2.25rem' | |||
|
|||
export default styled.button` | |||
background: ${({ theme }) => theme.secondary_300}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這行可以刪掉了吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這一行其實是 backgroundColor
沒傳的 default 值,但應該可以合併起來 ><
justify-self: center; | ||
` | ||
|
||
const EditWrapper = styled.form` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@
useEffect(() => { | ||
const now = new Date().toISOString().slice(0, 10) | ||
const nowStatus = | ||
now < beginDate ? '即將發佈' : now < finishDate ? '進行中' : '已截止' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可讀性不佳 QQ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像有點 XDD
setBeginDate(() => beginTime.slice(0, 10)) | ||
setFinishDate(() => finishTime.slice(0, 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這不用傳函數吧@@
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
對欸,原本用別的寫法要用,忘記改回來 XD
display: flex; | ||
flex-flow: row wrap; | ||
justify-content: space-between; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不用寫好的 flexJustifyAlign
了嗎 QQ
display: flex; | ||
justify-content: center; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
被遺忘的 flexJustifyAlign
const handleCopyQRcode = () => { | ||
navigator.clipboard.writeText(QRcodeImage).then( | ||
() => { | ||
alert('複製成功!') | ||
}, | ||
() => { | ||
alert('複製失敗 QQ') | ||
} | ||
) | ||
} | ||
|
||
const handleCopyURL = () => { | ||
navigator.clipboard.writeText(URL).then( | ||
() => { | ||
alert('複製成功!') | ||
}, | ||
() => { | ||
alert('複製失敗 QQ') | ||
} | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@
(10/03 更新)