Skip to content

Commit

Permalink
fix other pronoun field
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexite committed Nov 13, 2021
1 parent 47d6816 commit efcb6ea
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions src/components/UserProperty/Pronoun.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import Input from '@codeday/topo/Atom/Input/Text';
import FormControl, { Label } from '@codeday/topo/Atom/Form';
import Text, { Link } from '@codeday/topo/Atom/Text';
import Box from '@codeday/topo/Atom/Box'
import Radio, { Group, Stack } from '@codeday/topo/Atom/Input/Radio';

const CUSTOM = 'custom';
Expand All @@ -23,26 +24,29 @@ const Pronoun = ({ user, onChange }) => {
const defaultRadios = Object.keys(defaultPronouns)
.map((k) => <Radio key={k} value={k}>{defaultPronouns[k]}</Radio>);

const customRadio = (
<Radio key={CUSTOM} value={CUSTOM}>
{
custom || selection === CUSTOM
? (
<Input
value={custom}
onChange={(e) => {
setSelection(CUSTOM);
setCustom(e.target.value);
onChange({ pronoun: e.target.value });
}}
/>
) : (
<Text color="gray.500" as="span">(other)</Text>
)
}
</Radio>
);

const customRadio = (
<Box as="span">
<Radio key={CUSTOM} value={CUSTOM}>
{" "}
</Radio>
{
custom || selection === CUSTOM ? (
<Input
w={"auto"}
value={custom}
onChange={(e) => {
console.log(e)
setCustom(e.target.value);
onChange({ pronoun: e.target.value });
setSelection(CUSTOM);
}}
/>
) : (
<Text color="gray.500" as="span">(other)</Text>
)
}
</Box>
);
return (
<FormControl>
<Label fontWeight="bold">
Expand Down

0 comments on commit efcb6ea

Please sign in to comment.