Skip to content

Commit

Permalink
Feat: 렌더링 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
cjy3458 committed Mar 11, 2024
1 parent bc746c6 commit 5c85fa6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/mypage/component/ScoreHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BackgroundColor, Primary } from '@utils/constant/color';
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import styled from 'styled-components';
import MakeAttendanceButton from './MakeAttendanceButton';

Expand All @@ -10,9 +10,12 @@ interface UserProps {

const ScoreHeader = ({ isAdmin, name }: UserProps) => {
const [isPre, setIsPre] = useState<boolean>(false);
if (name === '최재영' || name === '박재윤') {
setIsPre(true);
}

useEffect(() => {
if (name === '최재영' || name === '박재윤') {
setIsPre(true);
}
}, [name]);

return (
<>
Expand Down

0 comments on commit 5c85fa6

Please sign in to comment.