Skip to content
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

Merged
merged 3 commits into from
Oct 4, 2021
Merged

add BackstagePage #15

merged 3 commits into from
Oct 4, 2021

Conversation

benben6515
Copy link
Collaborator

@benben6515 benben6515 commented Sep 30, 2021

(10/03 更新)

  • fixed theme, prop CSS problems.
  • add Homepage simple RWD.
  • redirect editing page to FormPage
  • TODO : FormPage with editing

  • 不囉唆,直上圖

Copy link
Collaborator

@rockyooooooo rockyooooooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大部分是命名的問題~

<Route exact path="/add">
<AddPage />
</Route>
<Route exact path="/form">
<FormPage />
</Route>
<Route exact path="/backstage">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

跟我的路由撞名ㄌ,開會討論怎麼改

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

待討論:

  1. 前台是單支留言 => /issue/奇怪的url
  2. 後台 => /backstage
  3. 後台總留言 => /backstage/issues
  4. 後台單支留言 => /backstage/issue or /backstage/issue/奇怪的url

justify-self: center;
`

const EditWrapper = styled.form`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這個名子可能要含有 form 比較知道原來他是個 form

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@

Copy link
Collaborator Author

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()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只解構要用的,讚

Comment on lines 15 to 30
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()
Copy link
Collaborator

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) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

命名感覺可以改成實際做了什麼事

Comment on lines 88 to 91
<Button onClick={() => handleClick('all')} active={filter === 'all'}>
<span>all</span>
<span>data</span>
</Button>
Copy link
Collaborator

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這個 'monotone' 要存成常數嗎

Comment on lines +55 to +75
const handleCopyQRcode = () => {
navigator.clipboard.writeText(QRcodeImage).then(
() => {
alert('複製成功!')
},
() => {
alert('複製失敗 QQ')
}
)
}

const handleCopyURL = () => {
navigator.clipboard.writeText(URL).then(
() => {
alert('複製成功!')
},
() => {
alert('複製失敗 QQ')
}
)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以寫成一個 function

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@

Copy link
Collaborator Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這個檔案是不是用不到了?

Comment on lines 3 to 7
const SectionWrapper = styled.div`
width: 100%;
${({ isGreyBackground }) => isGreyBackground && 'background: #f9f9f9;'}
`
// background: ${({ theme }) => theme.secondary_850};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theme 跟註解

然後我找不到什麼時候會用到 isGreyBackground XD

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EditSection 跟 GraphSection 有用到,他有傳 props

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

但是我看不到灰背景,我眼鏡業障重嗎

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

真的業障重

Copy link
Owner

@angelina524 angelina524 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

每個 section margin 在大一點 QQ,呼吸呼吸

{iconName('1x', theme.secondary_200)}
<span>{title}</span>
</div>
{location.pathname === '/backstage' && (
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一樣 url 待討論

font-size: 1rem;
text-align: center;
line-height: ${BUTTON_HEIGHT};
`
Copy link
Owner

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}
/>
Copy link
Owner

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;
Copy link
Owner

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

再補上編輯功能,感恩的心

)
}

export default GraphSection
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


顯示中文 please

`

const QRcodeSection = () => {
const QRcodeImage =
Copy link
Owner

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>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rockyooooooo 按此回頂端的樣式用這個好了,比較好看!!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

玩了一下 CSS 因為原本背景有點空 wwww

Comment on lines 3 to 7
const SectionWrapper = styled.div`
width: 100%;
${({ isGreyBackground }) => isGreyBackground && 'background: #f9f9f9;'}
`
// background: ${({ theme }) => theme.secondary_850};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EditSection 跟 GraphSection 有用到,他有傳 props

<TitleWrapperRight>
<h3>問卷調查</h3>
<p>按您的喜好設計並創建表單,</p>
<p>可快速搜集與整理觀眾的資料。</p>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

homepage 的 h3, p 用 cardList 寫好的資料套進去

Copy link
Collaborator

@rockyooooooo rockyooooooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有一些之前說的沒改到 ><

@@ -4,6 +4,7 @@ export const BUTTON_HEIGHT = '2.25rem'

export default styled.button`
background: ${({ theme }) => theme.secondary_300};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這行可以刪掉了吧

Copy link
Collaborator Author

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`
Copy link
Collaborator

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 ? '進行中' : '已截止'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可讀性不佳 QQ

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好像有點 XDD

Comment on lines 59 to 60
setBeginDate(() => beginTime.slice(0, 10))
setFinishDate(() => finishTime.slice(0, 10))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這不用傳函數吧@@

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

對欸,原本用別的寫法要用,忘記改回來 XD

Comment on lines 19 to 21
display: flex;
flex-flow: row wrap;
justify-content: space-between;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用寫好的 flexJustifyAlign 了嗎 QQ

Comment on lines 46 to 47
display: flex;
justify-content: center;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

被遺忘的 flexJustifyAlign

Comment on lines +55 to +75
const handleCopyQRcode = () => {
navigator.clipboard.writeText(QRcodeImage).then(
() => {
alert('複製成功!')
},
() => {
alert('複製失敗 QQ')
}
)
}

const handleCopyURL = () => {
navigator.clipboard.writeText(URL).then(
() => {
alert('複製成功!')
},
() => {
alert('複製失敗 QQ')
}
)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@

@benben6515 benben6515 merged commit 9a42d1c into dev Oct 4, 2021
@benben6515 benben6515 deleted the dev-css#8 branch October 4, 2021 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants