mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
fix pronouns type
This commit is contained in:
@@ -7,7 +7,7 @@ import React, { useState } from 'react';
|
||||
|
||||
export type SetupPronounsProps = {
|
||||
pronouns: string;
|
||||
setPronouns: React.Dispatch<React.SetStateAction<string | undefined>>;
|
||||
setPronouns: React.Dispatch<React.SetStateAction<string>>;
|
||||
};
|
||||
|
||||
export const SetupPronouns: React.FC<SetupPronounsProps> = ({
|
||||
@@ -31,7 +31,7 @@ export const SetupPronouns: React.FC<SetupPronounsProps> = ({
|
||||
const { error } = await updatePronouns({
|
||||
playerId: user.id,
|
||||
input: {
|
||||
pronouns: pronouns ?? '',
|
||||
pronouns,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -65,7 +65,6 @@ export const SetupPronouns: React.FC<SetupPronounsProps> = ({
|
||||
/>
|
||||
|
||||
<MetaButton
|
||||
disabled={!user}
|
||||
onClick={handleNextPress}
|
||||
mt={10}
|
||||
isLoading={updatePronounsRes.fetching || loading}
|
||||
|
||||
@@ -14,12 +14,12 @@ export const getStaticProps = async () => ({
|
||||
export type DefaultSetupProps = InferGetStaticPropsType<typeof getStaticProps>;
|
||||
|
||||
const PronounsSetup: React.FC<DefaultSetupProps> = () => {
|
||||
const [pronouns, setPronouns] = useState<string | undefined>(undefined);
|
||||
const [pronouns, setPronouns] = useState<string>('');
|
||||
const { user } = useUser();
|
||||
|
||||
if (user?.player) {
|
||||
const { player } = user;
|
||||
if (player.pronouns && pronouns === undefined) {
|
||||
if (player.pronouns && pronouns === '') {
|
||||
setPronouns(player.pronouns);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user