Skip to content

Commit

Permalink
fix: type 정의
Browse files Browse the repository at this point in the history
  • Loading branch information
saa00123 committed Sep 5, 2023
1 parent a07d22c commit 329a8de
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion front/src/components/frames/token/UserContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ type UserContextType = [

const UserContext = createContext<UserContextType | undefined>(undefined);

interface Member {
id: number;
name: string;
}

interface Team {
id: number;
name: string;
industryGroup: string;
}

interface TeamData {
id: number;
rank: string;
isAcceptMember: boolean;
isAcceptTeam: boolean;
nickname: string;
member: Member;
team: Team;
}

export const useUser = (): UserContextType => {
const context = useContext(UserContext);
if (!context) {
Expand All @@ -33,7 +54,7 @@ export const UserProvider: React.FC<{ children: React.ReactNode }> = ({
children,
}) => {
const [user, setUser] = useState<User | null>(null);
const [teamData, setTeamData] = useState(null);
const [teamData, setTeamData] = useState<TeamData[]>();
const navigate = useNavigate();

useEffect(() => {
Expand Down

0 comments on commit 329a8de

Please sign in to comment.