我正在开发一个项目,这是一个简单的雇佣者-工人平台。我已使用手动付款来保留关联帐户余额。我想测试员工关联账户中有一定余额后的支付情况。但余额显示在“即将可用”上。我读了文档,它说第一次付款需要 7-14 天。即使在测试模式下我也需要等待那么长时间吗?
我们可以使用组件选择器模式styled-components添加上下文样式。但是我们如何选择特定的父组件变体来根据上下文设置子组件的样式呢?例如,我们这里有三个组件,、和。ChildNoteWrapperNote
const Child = styled.div<{ editing?: boolean }>`
${props => props.editing && css`some styles`}
`
const NoteWrapper = styled.div<{ compact?: boolean }>`
${props => props.compact && css`some styles`}
`
const Note = styled.input`
/* How do I style this when Child is editing and NoteWrapper is compact */
`
const App = () => {
return (
<Child editing>
<NoteWrapper compact>
<Note/>
</NoteWrapper>
</Child>
)
}
`
Run Code Online (Sandbox Code Playgroud)
使用纯 CSS,我们可以做这样的事情
const Child = styled.div<{ editing?: …Run Code Online (Sandbox Code Playgroud)