Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix other pronoun field #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
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)
Nexite marked this conversation as resolved.
Show resolved Hide resolved
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