-
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.
1. Prop XXX did not match. Server: "null 或 AAA" Client: "OOO" → vercel/next.js#7322 (comment) 2. Transient Props 問題 → react 不認得的 prop 前面加 $ (component 本身也要加) 3. Tag Button Active 時的動畫做好 + 顏色改固定不隨機了 4. _document 因應 SSR 整個改寫 (參考 nextjs/example/with-styled-components) 5. 調整 theme 物件 color 的結構 (分為 toneColor(固定不變)、coreColor(亮暗模式會變)) 6. 取消在變換 Tag 時的 shallow routing (breadcrumb 配合調整如果沒有那頁面就顯示普通文字)
- Loading branch information
kyo144
committed
Jan 2, 2022
1 parent
18a3f21
commit 546f6b5
Showing
20 changed files
with
224 additions
and
160 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"presets": ["next/babel"], | ||
"plugins": ["styled-components"] | ||
"plugins": [["styled-components", { "ssr": true, "displayName": true, "preprocess": false }]] | ||
} |
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,11 +1,13 @@ | ||
import styled from 'styled-components' | ||
import { motion } from 'framer-motion' | ||
|
||
const TagButton = styled.button` | ||
const TagButton = styled(motion.button)` | ||
height: 32px; | ||
border-radius: 2px; | ||
border: none; | ||
background-color: ${({ theme, bgColor }) => bgColor ? bgColor : theme.color.core.tertiary}; | ||
color: ${({ theme }) => theme.color.core.secondary}; | ||
border: ${({ border }) => border}; | ||
background-color: ${({ bgColor }) => bgColor}; | ||
color: ${({ color }) => color}; | ||
font-weight: ${({ theme }) => theme.fontWeights.medium}; | ||
` | ||
|
||
export default TagButton |
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
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,10 @@ | ||
import React from 'react' | ||
import dynamic from 'next/dynamic' | ||
|
||
const NoSsr = ({ children }) => <>{children}</> | ||
|
||
export default dynamic(() => Promise.resolve(NoSsr), { ssr: false }) | ||
|
||
// * 2022-1-2 目前兩種 component 需要 dynamic with No SSR | ||
// * 1. 用到 Framer Motion 的 (使用到動畫的) | ||
// * 2. Dark Mode / Light Mode 樣式會變的 |
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,13 +1,8 @@ | ||
// * 產生 0 ~ 360 隨機數字 (色相環) 組成的 Array,Array 長度依照 Tag 數量 | ||
export const randomHueValue = length => { | ||
return Array.from({ length }, () => Math.floor(Math.random() * 360)+1) | ||
} | ||
|
||
// * 隨機和菓子色產生器 (用 HSL) | ||
export const randomPastelColor = value => { | ||
// * 和菓子色產生器 (用 HSL) | ||
export const pastelColor = value => { | ||
const minHue = 360 | ||
const maxHue = 0 | ||
const curPercent = (value - minHue) / (maxHue-minHue) | ||
const colorString = 'hsl(' + ((curPercent * (maxHue-minHue) ) + minHue) + ',85%,90%)' | ||
const colorString = 'hsl(' + ((curPercent * (maxHue-minHue) ) + minHue) + ',85%,75%)' | ||
return colorString | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.