Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

feat: support us page#1148

Merged
mydearxym merged 6 commits intodevfromsupport-us-page
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes fromall 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
6 changes: 3 additions & 3 deletionscypress/integration/friends/layout.spec.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
describe('friends page: ', () => {
describe('support-us page: ', () => {
// beforeEach(() => {
before(() => {
cy.visit('/friends')
cy.visit('/support-us')
})

it('basic layout', () => {
cy.id('header').should('be.visible')
cy.id('header-search').should('be.visible')
cy.id('header-search-icon').should('be.visible')

cy.id('friends-content').should('be.visible')
cy.id('support-us-content').should('be.visible')

// cypress can not load dynamic Footer
// cy.id('footer').should('be.visible')
Expand Down
6 changes: 3 additions & 3 deletionsserver/routes.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,9 +37,9 @@ router.route('/sponsor/:slug?').get((req, res) => {
return renderAndCache({ req, res, path: '/sponsor' })
})

//友情链接
router.route('/friends/:slug?').get((req, res) => {
return renderAndCache({ req, res, path: '/friends' })
//支持我们
router.route('/support-us/:slug?').get((req, res) => {
return renderAndCache({ req, res, path: '/support-us' })
})

// 升级账户
Expand Down
37 changes: 0 additions & 37 deletionssrc/components/BuyMeChuanChuan/ChuanSelector.js
View file
Open in desktop

This file was deleted.

36 changes: 36 additions & 0 deletionssrc/components/BuyMeChuanChuan/ChuanSelector.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
import { FC, memo } from 'react'

import { ICON_CMD } from '@/config'
import {
SelectBox,
ChuanChuanIcon,
Selectors,
By,
Circle,
} from './styles/chuan_selector'

type TProps = {
active: number
onSelect: (howMany: number) => void
}

const ChuanSelector: FC<TProps> = ({ active, onSelect }) => {
const options = [1, 5, 10, 50, 100]

return (
<SelectBox>
<ChuanChuanIcon src={`${ICON_CMD}/chuanchuan.svg`} />

<Selectors>
<By>x</By>
{options.map((item) => (
<Circle key={item} active={item === 1} onClick={() => onSelect(item)}>
1
</Circle>
))}
</Selectors>
</SelectBox>
)
}

export default memo(ChuanSelector)
34 changes: 0 additions & 34 deletionssrc/components/BuyMeChuanChuan/PaymentFooter.js
View file
Open in desktop

This file was deleted.

40 changes: 40 additions & 0 deletionssrc/components/BuyMeChuanChuan/PaymentFooter.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
import { FC, memo } from 'react'

import { ICON_CMD } from '@/config'
import Button from '@/components/Buttons/Button'

import {
Wrapper,
PayDesc,
AliPay,
Weixin,
MoneyNum,
PaymentIcon,
} from './styles/payment_footer'

type TProps = {
num: number
onPay: (m: number) => void
}

const PaymentFooter: FC<TProps> = ({ num, onPay }) => {
return (
<Wrapper>
<PayDesc>
支持:
<AliPay>
<PaymentIcon src={`${ICON_CMD}/alipay-color.svg`} />
</AliPay>
|
<Weixin>
<PaymentIcon src={`${ICON_CMD}/weichat-color.svg`} />
</Weixin>
</PayDesc>
<Button type="red" onClick={() => onPay(num * 10.24)}>
资助 <MoneyNum>¥{num * 10.24} 元</MoneyNum>
</Button>
</Wrapper>
)
}

export default memo(PaymentFooter)
20 changes: 20 additions & 0 deletionssrc/components/BuyMeChuanChuan/UnLoginNote.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
import { FC, memo } from 'react'

// import { ICON_CMD } from '@/config'
import { Wrapper, LoginLabel } from './styles/unlogin_note'

type TProps = {
onLogin: () => void
}

const UnLoginNote: FC<TProps> = ({ onLogin }) => {
return (
<Wrapper>
下一步操作前, 请先
<LoginLabel onClick={onLogin}>登录</LoginLabel>
你的账号
</Wrapper>
)
}

export default memo(UnLoginNote)
14 changes: 0 additions & 14 deletionssrc/components/BuyMeChuanChuan/UnloginNote.js
View file
Open in desktop

This file was deleted.

Original file line numberDiff line numberDiff line change
Expand Up@@ -4,16 +4,16 @@
*
*/

import React, { useState } from 'react'
import T from 'prop-types'
import { FC, useState, memo } from 'react'

import { ICON_CMD, GITHUB_CPS_TEAM } from '@/config'
import { buildLog } from '@/utils/logger'
import { useAccount } from '@/stores/init'

import Modal from '@/components/Modal'
import UserCell from '@/components/UserCell'

import UnLoginNote from './UnloginNote'
import UnLoginNote from './UnLoginNote'
import ChuanSelector from './ChuanSelector'
import PaymentFooter from './PaymentFooter'

Expand All@@ -34,7 +34,20 @@ import {
/* eslint-disable-next-line */
const log = buildLog('c:Footer:index')

const BuyMeChuanChuan = ({ show, accountInfo, onClose, onLogin, onPay }) => {
type TProps = {
show?: boolean
onClose?: () => void
onLogin?: () => void
onPay?: (m: number) => void
}

const BuyMeChuanChuan: FC<TProps> = ({
show = false,
onClose = log,
onLogin = log,
onPay = log,
}) => {
const accountInfo = useAccount()
const [activeChuan, setActiveChuan] = useState(1)

return (
Expand DownExpand Up@@ -66,8 +79,7 @@ const BuyMeChuanChuan = ({ show, accountInfo, onClose, onLogin, onPay }) => {
</SelectTitle>

<SelectDesc>
你的资助将主要用于 coderplanets
网站的开发和维护,使之更加稳定可靠。开源项目的巨大时间和物质成本无法仅靠情怀支撑,望理解。
你的远程投喂将有助于开发团队在饱腹状态下工作, Cheers!
</SelectDesc>

<ChuanSelector active={activeChuan} onSelect={setActiveChuan} />
Expand All@@ -81,26 +93,4 @@ const BuyMeChuanChuan = ({ show, accountInfo, onClose, onLogin, onPay }) => {
)
}

BuyMeChuanChuan.propTypes = {
// https://www.npmjs.com/package/prop-types
accountInfo: T.shape({
id: T.string,
avatar: T.string,
nickname: T.string,
isLogin: T.bool,
}),
show: T.bool,
onClose: T.func,
onLogin: T.func,
onPay: T.func,
}

BuyMeChuanChuan.defaultProps = {
accountInfo: {},
show: false,
onClose: log,
onLogin: log,
onPay: log,
}

export default React.memo(BuyMeChuanChuan)
export default memo(BuyMeChuanChuan)
20 changes: 11 additions & 9 deletionssrc/components/BuyMeChuanChuan/styles/chuan_selector.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,25 +33,27 @@ export const Selectors = styled.div`
${css.flex()};
`
export const By = styled.div`
${css.size(40)};
${css.flex('align-both')};

${css.size(40)};
font-size: 1.6rem;
color: ${theme('font')};
margin-left: -10px;
font-size: 30px;
color: ${theme('thread.articleDigest')};
margin-left: -20px;
padding-bottom: 8px;
transform: scaleY(0.8);
opacity: 0.9;
`

export const Circle = styled.div<TActive>`
${css.flex('align-both')};
${css.circle(38)};
${css.flex('align-both')};
border: 1px solid;
border-color: ${theme('font')};
margin-right: 10px;
color: ${({ active }) => (active ? 'white' :'#51abb2')};
color: ${({ active }) => (active ? 'white' :theme('thread.articleTitle'))};
background-color: ${({ active }) => (active ? theme('font') : '')};
&:hover {
cursor: pointer;
animation: ${animate.pulse} 0.4s linear;
animation: ${animate.pulse} 0.3s linear;
}
transition: background-color 0.3s ease-out;
transition: background-color 0.2s ease-out;
`
21 changes: 8 additions & 13 deletionssrc/components/BuyMeChuanChuan/styles/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,21 +20,19 @@ export const Header = styled.div`
margin-left: 20px;
margin-bottom: 20px;
`

export const BuyChuanChuan = styled.div`
${css.flex()};
`
export const ChuanChuanDesc = styled.div`
width: 50%;
`

// source: https://unsplash.com/photos/vzX2rgUbQXM
export const FoodPic = styled.img`
width: 80%;
height: auto;
display: block;
margin: 0 auto;
border-radius:5px;
border-radius:10px;
`
export const ChuanChuanSelect = styled.div`
${css.flexColumn()};
Expand All@@ -43,13 +41,12 @@ export const ChuanChuanSelect = styled.div`
export const SelectTitle = styled.div`
${css.flex()};
margin-left: 5px;
color: ${theme('banner.desc')};
font-size:1.2rem;
color: ${theme('thread.articleTitle')};
font-size:18px;
`
export const TeamName = styled.a`
${css.flex()};
transition: color 0.3s;
color: ${theme('banner.title')};
color: ${theme('thread.articleTitle')};
margin-left: 6px;
margin-right: 6px;

Expand All@@ -64,15 +61,13 @@ export const NameLinkIcon = styled(Img)`
${css.size(20)};
padding-top: 3px;
`

export const SelectDesc = styled.div`
margin-top: 5px;
margin-top: 15px;
margin-bottom: 30px;
margin-left: 5px;
font-size: 0.9rem;
margin-bottom: 12px;
color: ${theme('banner.desc')};
font-size: 14px;
color: ${theme('thread.articleDigest')};
`

export const SelectHolder = styled.div`
flex-grow: 1;
`
Loading

[8]ページ先頭

©2009-2025 Movatter.jp