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
feat(membership): invite friend workflow concept#1071
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
4 commits Select commitHold shift + click to select a range
24c9ae2
refactor(membership): convert to ts
mydearxym918674b
refactor(membership): basic pin-code workflow
mydearxym754a643
refactor(membership): basic pin-code workflow
mydearxym1e9eef8
refactor(membership): friend-invite basic workflow && styles
mydearxymFile 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
2 changes: 2 additions & 0 deletionspackage.json
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
1 change: 1 addition & 0 deletionspublic/icons/static/shape/handshake.svg
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions...ershipContent/Illustrations/AirBalloon.js → ...rshipContent/Illustrations/AirBalloon.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
14 changes: 11 additions & 3 deletions...MembershipContent/Illustrations/Rocket.js → ...embershipContent/Illustrations/Rocket.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
11 changes: 8 additions & 3 deletions...nt/MembershipContent/Illustrations/UFO.js → ...t/MembershipContent/Illustrations/UFO.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
13 changes: 9 additions & 4 deletions.../MembershipContent/Illustrations/index.js → ...MembershipContent/Illustrations/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
25 changes: 25 additions & 0 deletionssrc/containers/content/MembershipContent/InviteBox/QA.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,25 @@ | ||
import React, { FC } from 'react' | ||
import { Br } from '@/components/Common' | ||
import { Wrapper, Title, Desc } from '../styles/invite_box/qa' | ||
type TProps = { | ||
testid?: string | ||
} | ||
const QA: FC<TProps> = ({ testid = 'membership-qa' }) => { | ||
return ( | ||
<Wrapper testid={testid}> | ||
<Title>说明:</Title> | ||
<Desc> | ||
内侧阶段,所有新注册用户都会收到一个额外的朋友码,欢迎将它分享给身边的朋友。 | ||
</Desc> | ||
<Br top={2} /> | ||
<Desc>验证通过后将自动升级为高级账户,为期一年。</Desc> | ||
<Br top={12} /> | ||
<Desc>感谢你对 coderplanets 的关注和支持。</Desc> | ||
</Wrapper> | ||
) | ||
} | ||
export default QA |
57 changes: 57 additions & 0 deletionssrc/containers/content/MembershipContent/InviteBox/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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React, { FC, useEffect, useRef } from 'react' | ||
import ReactPinField from 'react-pin-field' | ||
import { ICON } from '@/config' | ||
import Modal from '@/components/Modal' | ||
import QA from './QA' | ||
import { | ||
Wrapper, | ||
PinCodeWrapper, | ||
Header, | ||
HandIcon, | ||
Title, | ||
} from '../styles/invite_box' | ||
import { closeInviteBox } from '../logic' | ||
type TProps = { | ||
testid?: string | ||
show: boolean | ||
} | ||
const InviteBox: FC<TProps> = ({ testid = 'membership-invite-box', show }) => { | ||
const ref = useRef(null) | ||
useEffect(() => { | ||
if (show && ref) { | ||
ref.current[0].focus() | ||
} | ||
}, [show, ref]) | ||
return ( | ||
<Modal | ||
width="420px" | ||
show={show} | ||
onClose={() => closeInviteBox()} | ||
showCloseBtn | ||
> | ||
<Wrapper testid={testid}> | ||
<Header> | ||
<HandIcon src={`${ICON}/shape/handshake.svg`} /> | ||
<Title>朋友码</Title> | ||
</Header> | ||
<PinCodeWrapper> | ||
<ReactPinField | ||
ref={ref} | ||
length={6} | ||
onChange={(v) => console.log('v: ', v)} | ||
/> | ||
</PinCodeWrapper> | ||
<QA /> | ||
</Wrapper> | ||
</Modal> | ||
) | ||
} | ||
export default InviteBox |
4 changes: 2 additions & 2 deletions...ntent/MembershipContent/MonthlyWarning.js → ...tent/MembershipContent/MonthlyWarning.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
18 changes: 15 additions & 3 deletions...ers/content/MembershipContent/PriceTag.js → ...rs/content/MembershipContent/PriceTag.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
10 changes: 7 additions & 3 deletions...ontainers/content/MembershipContent/QA.js → ...ntainers/content/MembershipContent/QA.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
9 changes: 8 additions & 1 deletion...ners/content/MembershipContent/Support.js → ...ers/content/MembershipContent/Support.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
14 changes: 8 additions & 6 deletionssrc/containers/content/MembershipContent/constant.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import type { TPay, TPackage } from './spec' | ||
export const PAY = { | ||
YEARLY: 'yearly' as TPay, | ||
MONTHLY: 'monthly' as TPay, | ||
} | ||
export const PACKAGE = { | ||
GIRL: 'girl' as TPackage, | ||
FREE: 'free' as TPackage, | ||
ADVANCE: 'advance' as TPackage, | ||
TEAM: 'team' as TPackage, | ||
} |
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.