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 : DropDown and NavBar component #4

Merged
merged 9 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 69 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,76 @@ git checkout -b <branch-name> # 這邊 <branch-name> 就直接用自己的名字
```
> 目前有設好 Github Action,會自動部署 `main` 的內容到 `gh-pages` 分支

## 合併流程
### 合併流程
- 在自己的 branch 開發完 push 回 origin
- 開一個 Pull Request,如果只是一些小小的改動可以自己直接 merge 到 main。如果是較大的改動要給其他成員 code review 的話就在 discord 通知一聲,沒問題的話就再 merge。

## Components

### Router
可以先參考 `/src/data/navBar.json` 這邊的定義
> spec 沒有特別定 <br>
> 所以我這邊就先照著翻譯(?)<br>

### Navbar
從 `/src/data/navBar.json` 讀取資料 <br>
如果要新增新的 navbar item 就直接在`/src/data/navBar.json` 加就好 <br>
props :
- `theme` : `light` or `dark` (default: `light`)

`navBar.json` schema :
> 如果 `linkList` 只有 1 個的話,就不會顯示 dropdown
```json
[
{
"title": "關於單車節",
"linkList" : [
{
"name": "關於單車節",
"link": "/about"
}
]
},
{
"title": "參加資訊",
"linkList" : [
{
"name": "交通資訊",
"link": "/information/traffic"
},
{
"name": "攤位地圖",
"link": "/information/map"
},
{
"name": "行程表",
"link": "/information/schedule"
},
{
"name": "我的行程",
"link": "/information/mySchedule"
}
]
},
// ...
]
```


### DropDown
props :
- `title` : dropdown 顯示的名字
- `linkList` : hover 會顯示的 `<a>` 列表
- `name` : `<a>` 顯示的名字
- `link` : `<a>` 的連結


## Reference

- hover on change in tailwindcss:
- https://stackoverflow.com/questions/60917112/displaying-button-when-hovering-over-div-in-tailwindcss
```html
<div class="group">
<button class="hidden group-hover:block">Child</button>
</div>
```
3 changes: 3 additions & 0 deletions public/home/ellipse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/home/key-visual-bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/home/key-visual.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions public/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading