-
Notifications
You must be signed in to change notification settings - Fork 12
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 #15 from Barba828/feat-layout
Feat layout
- Loading branch information
Showing
27 changed files
with
980 additions
and
129 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
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 was deleted.
Oops, something went wrong.
7 changes: 2 additions & 5 deletions
7
...omponents/audio-btn/audio-btn.module.scss → ...omponents/fixed-btn/audio-btn.module.scss
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
23 changes: 23 additions & 0 deletions
23
packages/buitar/src/components/fixed-btn/fixed-btns.module.scss
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,23 @@ | ||
.btn-group { | ||
position: fixed; | ||
right: 20px; | ||
bottom: 100px; | ||
z-index: 99; | ||
} | ||
.btn { | ||
width: 32px; | ||
height: 32px; | ||
cursor: pointer; | ||
margin: $space-6; | ||
background: $gray-02; | ||
border-radius: 50%; | ||
border: none; | ||
color: inherit; | ||
opacity: 0.8; | ||
@include flex-center; | ||
@media (any-hover: hover) { | ||
&:hover { | ||
background: $gray-03; | ||
} | ||
} | ||
} |
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,14 @@ | ||
import { FC } from 'react' | ||
import { AudioBtn } from './audio-btn' | ||
import { SettingBtn } from './setting-btn' | ||
|
||
import styles from './fixed-btns.module.scss' | ||
|
||
export const FixedBtns: FC<{}> = () => { | ||
return ( | ||
<div className={styles['btn-group']}> | ||
<AudioBtn className={styles['btn']}></AudioBtn> | ||
<SettingBtn className={styles['btn']}></SettingBtn> | ||
</div> | ||
) | ||
} |
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,2 @@ | ||
export * from './audio-btn' | ||
export * from './fixed-btns' |
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,21 @@ | ||
import { FC, memo, useState, useCallback } from 'react' | ||
import { BoardOptionsController, Icon, Modal } from '@/components' | ||
|
||
export const SettingBtn: FC<React.HTMLAttributes<HTMLButtonElement>> = memo((props) => { | ||
const [settingModalVisible, setSettingModalVisible] = useState<boolean>(false) | ||
const toggleSettingModalVisible = useCallback(() => { | ||
setSettingModalVisible(!settingModalVisible) | ||
}, [settingModalVisible]) | ||
return ( | ||
<button id="setting-btn" className={props.className}> | ||
<Icon name="icon-setting" onClick={toggleSettingModalVisible} /> | ||
<Modal | ||
visible={settingModalVisible} | ||
onCancel={toggleSettingModalVisible} | ||
onConfirm={toggleSettingModalVisible} | ||
> | ||
<BoardOptionsController /> | ||
</Modal> | ||
</button> | ||
) | ||
}) |
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,3 @@ | ||
export { PagesIntro } from './pages-intro.component' | ||
export { PageHeader } from './page-header.component' | ||
export { PagesMeta } from './pages-meta' |
24 changes: 24 additions & 0 deletions
24
packages/buitar/src/components/pages-info/page-header.component.tsx
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,24 @@ | ||
import { useMemo, memo } from 'react' | ||
import { useRouteMatch } from '@/utils/hooks/use-routers' | ||
import { Icon } from '@/components/icon' | ||
import { useNavigate } from 'react-router-dom' | ||
|
||
import styles from './page-header.module.scss' | ||
|
||
export const PageHeader = memo(() => { | ||
const curRoute = useRouteMatch() | ||
const navigate = useNavigate() | ||
const showBack = useMemo(() => !!curRoute?.meta?.back, [curRoute]) | ||
|
||
if(showBack){ | ||
return ( | ||
<header className={styles['page-header']} onClick={() => navigate(-1)}> | ||
<Icon name="icon-back" size={16}></Icon> | ||
<h2>{curRoute.name}</h2> | ||
</header> | ||
) | ||
} | ||
|
||
return null | ||
|
||
}) |
10 changes: 10 additions & 0 deletions
10
packages/buitar/src/components/pages-info/page-header.module.scss
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 @@ | ||
.page-header { | ||
display: flex; | ||
align-items: center; | ||
cursor: pointer; | ||
|
||
> h2 { | ||
margin: $font-16 $font-10; | ||
font-size: $font-20; | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...nents/pages-intro/pages-intro.module.scss → ...onents/pages-info/pages-intro.module.scss
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
File renamed without changes.
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.