This repository was archived by the owner on Nov 8, 2022. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork37
refactor: UI/UX adjust#1142
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
22 changes: 22 additions & 0 deletionssrc/containers/tool/JoinModal/Content.tsx
This file contains hidden or 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,22 @@ | ||
import { FC, memo } from 'react' | ||
import { INGroup, RGroup } from './Groups' | ||
import { GROUPS } from './constant' | ||
type TProps = { | ||
activeGroup: string | ||
} | ||
const Content: FC<TProps> = ({ activeGroup }) => { | ||
switch (activeGroup) { | ||
case 'R': { | ||
return <RGroup qr={GROUPS[activeGroup].QR} /> | ||
} | ||
default: { | ||
return <INGroup qr={GROUPS[activeGroup].QR} /> | ||
} | ||
} | ||
} | ||
export default memo(Content) |
35 changes: 35 additions & 0 deletionssrc/containers/tool/JoinModal/Footer.tsx
This file contains hidden or 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,35 @@ | ||
import { FC, memo } from 'react' | ||
import Button from '@/components/Buttons/Button' | ||
import { | ||
Wrapper, | ||
Note, | ||
WelcomeWrapper, | ||
Welcome, | ||
WelcomeDesc, | ||
} from './styles/footer' | ||
type TProps = { | ||
onConfirm: () => void | ||
mask: boolean | ||
} | ||
const Footer: FC<TProps> = ({ onConfirm, mask }) => { | ||
return ( | ||
<Wrapper> | ||
<Note> | ||
为营造一个有意义的交流氛围,请阅读对应的「进群须知」后谨慎加入,谢谢理解。 | ||
</Note> | ||
{mask ? ( | ||
<Button onClick={onConfirm}>确定加入</Button> | ||
) : ( | ||
<WelcomeWrapper> | ||
<Welcome>欢迎加入</Welcome> | ||
<WelcomeDesc>期待你的宝贵意见</WelcomeDesc> | ||
</WelcomeWrapper> | ||
)} | ||
</Wrapper> | ||
) | ||
} | ||
export default memo(Footer) |
23 changes: 0 additions & 23 deletionssrc/containers/tool/JoinModal/FooterWechat.js
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
83 changes: 83 additions & 0 deletionssrc/containers/tool/JoinModal/Groups.tsx
This file contains hidden or 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,83 @@ | ||
import { FC, useState } from 'react' | ||
import Footer from './Footer' | ||
import { | ||
Wrapper, | ||
InnerWrapper, | ||
QRCodePic, | ||
Title, | ||
DescWrapper, | ||
UL, | ||
LI, | ||
Focus, | ||
} from './styles/groups' | ||
type TProps = { | ||
qr: string | ||
} | ||
export const INGroup: FC<TProps> = ({ qr }) => { | ||
const [mask, setMask] = useState(true) | ||
return ( | ||
<Wrapper> | ||
<InnerWrapper> | ||
<QRCodePic src={qr} noLazy mask={mask} /> | ||
<DescWrapper> | ||
<Title>进群须知:</Title> | ||
<UL> | ||
<LI> | ||
本群内<Focus>仅限于</Focus>讨论和「CoderPlanets」相关的话题。 | ||
</LI> | ||
<LI> | ||
除自我介绍外,在本群内<Focus>摸鱼吹水等同于自我退群声明</Focus>。 | ||
</LI> | ||
<LI> | ||
本群<Focus>不欢迎潜水</Focus> | ||
,每月会不定期清理潜水人员以保持低水位,请确保你对本社区有持续的兴趣。 | ||
</LI> | ||
<LI> | ||
群内有价值的内容会<Focus>定期同步</Focus> | ||
到反馈建议子社区,你不会因为不在群里而错过任何东西。 | ||
</LI> | ||
</UL> | ||
</DescWrapper> | ||
</InnerWrapper> | ||
<Footer onConfirm={() => setMask(false)} mask={mask} /> | ||
</Wrapper> | ||
) | ||
} | ||
// 雷达站 | ||
export const RGroup: FC<TProps> = ({ qr }) => { | ||
const [mask, setMask] = useState(true) | ||
return ( | ||
<Wrapper> | ||
<InnerWrapper> | ||
<QRCodePic src={qr} noLazy mask={mask} /> | ||
<DescWrapper> | ||
<Title>进群须知:</Title> | ||
<UL> | ||
<LI> | ||
本群内<Focus>仅限于</Focus> | ||
讨论信息(源)搜集等「雷达」相关的话题。 | ||
</LI> | ||
<LI> | ||
除自我介绍外,在本群内<Focus>摸鱼吹水等同于自我退群声明</Focus>。 | ||
</LI> | ||
<LI> | ||
本群<Focus>不欢迎潜水</Focus> | ||
,每月会不定期清理潜水人员以保持低水位,请确保你对本社区有持续的兴趣。 | ||
</LI> | ||
<LI> | ||
群内有价值的内容会<Focus>定期同步</Focus> | ||
到各个社区的雷达版块,你不会因为不在群里而错过任何东西。 | ||
</LI> | ||
</UL> | ||
</DescWrapper> | ||
</InnerWrapper> | ||
<Footer onConfirm={() => setMask(false)} mask={mask} /> | ||
</Wrapper> | ||
) | ||
} |
46 changes: 46 additions & 0 deletionssrc/containers/tool/JoinModal/Header.tsx
This file contains hidden or 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,46 @@ | ||
import { FC, memo } from 'react' | ||
import { keys } from 'ramda' | ||
import { ICON } from '@/config' | ||
import { SpaceGrow } from '@/components/Common' | ||
import Tooltip from '@/components/Tooltip' | ||
import { GROUPS } from './constant' | ||
import { | ||
Wrapper, | ||
WechatLogo, | ||
Title, | ||
SelectWrapper, | ||
Letter, | ||
} from './styles/header' | ||
import { switchGroup } from './logic' | ||
type TProps = { | ||
activeGroup: string | ||
} | ||
const Header: FC<TProps> = ({ activeGroup }) => { | ||
return ( | ||
<Wrapper> | ||
<Title> | ||
<WechatLogo src={`${ICON}/social/wechat-share.png`} /> 加入微信群 | ||
</Title> | ||
<SpaceGrow /> | ||
<SelectWrapper> | ||
{keys(GROUPS).map((group) => ( | ||
<Tooltip key={group} content={GROUPS[group].title}> | ||
<Letter | ||
$active={activeGroup === group} | ||
onClick={() => switchGroup(group)} | ||
> | ||
{group} | ||
</Letter> | ||
</Tooltip> | ||
))} | ||
</SelectWrapper> | ||
</Wrapper> | ||
) | ||
} | ||
export default memo(Header) |
32 changes: 32 additions & 0 deletionssrc/containers/tool/JoinModal/constant.tsx
This file contains hidden or 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,32 @@ | ||
import { ICON_BASE } from '@/config' | ||
export const GROUPS = { | ||
IN: { | ||
title: 'CP 内测群', | ||
QR: `${ICON_BASE}/cps_wechat_group.png`, | ||
}, | ||
// V: { | ||
// title: 'CP 志愿者', | ||
// QR: `${ICON_BASE}/cps_wechat_group.png`, | ||
// }, | ||
// 雷达站 | ||
R: { | ||
title: 'CP 雷达站', | ||
QR: `${ICON_BASE}/cps_wechat_group.png`, | ||
}, | ||
// 创作者群 | ||
W: { | ||
title: 'CP Makers', | ||
QR: `${ICON_BASE}/cps_wechat_group.png`, | ||
}, | ||
G: { | ||
title: 'CP 酷导航', | ||
QR: `${ICON_BASE}/cps_wechat_group.png`, | ||
}, | ||
D: { | ||
title: 'CP 来一杯', | ||
QR: `${ICON_BASE}/cps_wechat_group.png`, | ||
}, | ||
} | ||
export const holder = 1 |
32 changes: 14 additions & 18 deletionssrc/containers/tool/JoinModal/index.js → src/containers/tool/JoinModal/index.tsx
This file contains hidden or 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,45 +1,41 @@ | ||
/* | ||
* JoinModal | ||
*/ | ||
import { FC } from 'react' | ||
import { buildLog } from '@/utils/logger' | ||
import { pluggedIn } from '@/utils/mobx' | ||
import Modal from '@/components/Modal' | ||
import Header from './Header' | ||
import Content from './Content' | ||
import type { TStore } from './store' | ||
import { Wrapper } from './styles' | ||
import { useInit, onClose } from './logic' | ||
/* eslint-disable-next-line */ | ||
const log = buildLog('C:JoinModal') | ||
type TProps = { | ||
joinModal?: TStore | ||
} | ||
const JoinModalContainer: FC<TProps> = ({ joinModal: store }) => { | ||
useInit(store) | ||
const { show, activeGroup } = store | ||
return ( | ||
<Modal width="600px" show={show} showCloseBtn onClose={onClose}> | ||
<Wrapper testid="joinModal"> | ||
<Header activeGroup={activeGroup} /> | ||
<Content activeGroup={activeGroup} /> | ||
</Wrapper> | ||
</Modal> | ||
) | ||
} | ||
export default pluggedIn(JoinModalContainer) as FC<TProps> |
20 changes: 14 additions & 6 deletionssrc/containers/tool/JoinModal/logic.js → src/containers/tool/JoinModal/logic.ts
This file contains hidden or 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
10 changes: 4 additions & 6 deletionssrc/containers/tool/JoinModal/store.js → src/containers/tool/JoinModal/store.ts
This file contains hidden or 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.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.