fix some feedback from belen

This commit is contained in:
Sebastian 2021-09-20 00:18:52 -03:00
parent 62b64cb453
commit 08bc5c6d89
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1
3 changed files with 24 additions and 12 deletions

View File

@ -28,6 +28,11 @@ export function ExchangeXmlTos({ doc }: { doc: Document }) {
</Fragment> </Fragment>
} }
/**
* Map XML elements into HTML
* @param child
* @returns
*/
function renderChild(child: Element): VNode { function renderChild(child: Element): VNode {
const children = Array.from(child.children) const children = Array.from(child.children)
switch (child.nodeName) { switch (child.nodeName) {
@ -55,13 +60,16 @@ function renderChild(child: Element): VNode {
} }
} }
/**
* Simple anchor with a state persisted into 'data-open' prop
* @returns
*/
function AnchorWithOpenState(props: JSXInternal.HTMLAttributes<HTMLAnchorElement>) { function AnchorWithOpenState(props: JSXInternal.HTMLAttributes<HTMLAnchorElement>) {
const [open, setOpen] = useState<boolean>(false) const [open, setOpen] = useState<boolean>(false)
function doClick(e: JSXInternal.TargetedMouseEvent<HTMLAnchorElement>) { function doClick(e: JSXInternal.TargetedMouseEvent<HTMLAnchorElement>) {
setOpen(!open); setOpen(!open);
e.stopPropagation();
e.preventDefault(); e.preventDefault();
} }
return <a data-open={JSON.stringify(open)} onClick={doClick} {...props} /> return <a data-open={open ? 'true' : 'false'} onClick={doClick} {...props} />
} }

View File

@ -339,6 +339,9 @@ export const ButtonBoxSuccess = styled(ButtonBox)`
export const ButtonWarning = styled(ButtonVariant)` export const ButtonWarning = styled(ButtonVariant)`
background-color: rgb(223, 117, 20); background-color: rgb(223, 117, 20);
` `
export const LinkWarning = styled(Link)`
color: rgb(223, 117, 20);
`
export const ButtonBoxWarning = styled(ButtonBox)` export const ButtonBoxWarning = styled(ButtonBox)`
color: rgb(223, 117, 20); color: rgb(223, 117, 20);
border-color: rgb(223, 117, 20); border-color: rgb(223, 117, 20);
@ -641,14 +644,17 @@ export const TermsOfService = styled.div`
} }
a { a {
text-decoration: none;
color: inherit;
flex-direction: column;
}
& > a {
border: 1px solid black; border: 1px solid black;
border-radius: 5px; border-radius: 5px;
padding: 1em; padding: 1em;
margin-top: 2px; margin-top: 2px;
margin-bottom: 2px; margin-bottom: 2px;
text-decoration: none;
color: inherit;
flex-direction: column;
display: flex; display: flex;
&[data-open="true"] { &[data-open="true"] {
@ -666,10 +672,10 @@ export const TermsOfService = styled.div`
height: auto; height: auto;
} }
&[data-open="true"] header:after { &[data-open="true"] > header:after {
content: '\\2227'; content: '\\2227';
} }
&[data-open="false"] header:after { &[data-open="false"] > header:after {
content: '\\2228'; content: '\\2228';
} }
} }

View File

@ -28,7 +28,7 @@ import { CheckboxOutlined } from '../components/CheckboxOutlined';
import { ExchangeXmlTos } from '../components/ExchangeToS'; import { ExchangeXmlTos } from '../components/ExchangeToS';
import { LogoHeader } from '../components/LogoHeader'; import { LogoHeader } from '../components/LogoHeader';
import { Part } from '../components/Part'; import { Part } from '../components/Part';
import { ButtonDestructive, ButtonSuccess, ButtonWarning, LinkSuccess, TermsOfService, WalletAction } from '../components/styled'; import { ButtonDestructive, ButtonSuccess, ButtonWarning, LinkSuccess, LinkWarning, TermsOfService, WalletAction } from '../components/styled';
import { import {
acceptWithdrawal, getExchangeWithdrawalInfo, getWithdrawalDetailsForUri, onUpdateNotification, setExchangeTosAccepted acceptWithdrawal, getExchangeWithdrawalInfo, getWithdrawalDetailsForUri, onUpdateNotification, setExchangeTosAccepted
} from "../wxApi"; } from "../wxApi";
@ -42,8 +42,6 @@ export interface ViewProps {
details: ExchangeWithdrawDetails; details: ExchangeWithdrawDetails;
amount: string; amount: string;
onWithdraw: () => Promise<void>; onWithdraw: () => Promise<void>;
// setCancelled: (b: boolean) => void;
// setSelecting: (b: boolean) => void;
onReview: (b: boolean) => void; onReview: (b: boolean) => void;
onAccept: (b: boolean) => void; onAccept: (b: boolean) => void;
reviewing: boolean; reviewing: boolean;
@ -171,9 +169,9 @@ export function View({ details, amount, onWithdraw, terms, reviewing, onReview,
</ButtonSuccess> </ButtonSuccess>
} }
{terms.status === 'notfound' && {terms.status === 'notfound' &&
<ButtonDestructive upperCased disabled> <LinkWarning upperCased>
{i18n.str`Exchange doesn't have terms of service`} {i18n.str`Exchange doesn't have terms of service`}
</ButtonDestructive> </LinkWarning>
} }
</section> </section>
</WalletAction> </WalletAction>