@@ -6,15 +6,10 @@ import {
66 Row ,
77 Space ,
88 Tabs ,
9- Tag ,
109 Timeline ,
1110 Typography ,
1211} from "antd" ;
13- import {
14- ClockCircleOutlined ,
15- FontSizeOutlined ,
16- UserOutlined ,
17- } from "@ant-design/icons" ;
12+ import { ClockCircleOutlined , UserOutlined } from "@ant-design/icons" ;
1813
1914import moment from "moment" ;
2015import "moment/locale/pt" ;
@@ -24,19 +19,13 @@ import Document from "~/components/Document";
2419import * as api from "bokkenjs" ;
2520import * as socials from "~/lib/social" ;
2621import { notifyError , notifyInfo } from "~/components/Notification" ;
27- import styles from "./style.module.css" ;
2822import { EUser , getNinjasAsAdmin , updateGuardianAsAdmin } from "bokkenjs" ;
29-
30- import { BsFileEarmarkPersonFill } from "react-icons/bs" ;
3123import Link from "next/link" ;
32-
33- import { getIcon , getImg } from "~/lib/utils" ;
34- import Guardian from "pages/admin/guardians" ;
35- import { icons } from "react-icons" ;
24+ import { getIcon } from "~/lib/utils" ;
3625
3726const { TabPane } = Tabs ;
3827
39- const { Title, Text } = Typography ;
28+ const { Title } = Typography ;
4029
4130interface Props {
4231 id : string ;
@@ -49,8 +38,7 @@ function Profile({ id, role }: Props) {
4938 const [ projects , setProjects ] = useState < any [ ] > ( [ ] ) ;
5039 const [ skills , setSkills ] = useState < any [ ] > ( [ ] ) ;
5140 const [ date , setDate ] = useState < string > ( "" ) ;
52- const [ guardian , setGuardians ] = useState < any [ ] > ( [ ] ) ;
53- const [ ninja , setNinja ] = useState < any [ ] > ( [ ] ) ;
41+ const [ guardian , setGuardians ] = useState < any | null > ( [ ] ) ;
5442
5543 useEffect ( ( ) => {
5644 const fetchUserByRole = async ( ) => {
@@ -135,8 +123,7 @@ function Profile({ id, role }: Props) {
135123 api
136124 . getGuardian ( info . guardian_id )
137125 . then ( ( response : any ) => setGuardians ( response . data ) )
138- . catch ( ( error : any ) => {
139- } ) ;
126+ . catch ( ( error : any ) => { } ) ;
140127 }
141128 } , [ info . guardian_id , role ] ) ;
142129 console . log ( badges ) ;
@@ -211,7 +198,7 @@ function Profile({ id, role }: Props) {
211198 display : "inline-block" ,
212199 fontSize : 20 ,
213200 marginRight : "6px" ,
214- color :"#424549"
201+ color : "#424549" ,
215202 } }
216203 key = { s . id }
217204 >
@@ -278,122 +265,3 @@ function Profile({ id, role }: Props) {
278265}
279266
280267export default Profile ;
281-
282- {
283- /* <Row justify="center" align="middle">
284- <Space size="large">
285- <Avatar
286- size={{
287- xs: 100,
288- sm: 200,
289- md: 200,
290- lg: 200,
291- xl: 200,
292- xxl: 200,
293- }}
294- src={info?.photo}
295- icon={<UserOutlined />}
296- />
297- <Row justify="center" align="middle">
298- <Col span={24}>
299- <Title level={2}>
300- {info.first_name} {info.last_name}
301- </Title>
302- </Col>
303- <Col span={24}>
304- <Title className={styles.capitalize} level={4}>
305- <BsFileEarmarkPersonFill />{role}
306- </Title>
307- </Col>
308- <Col span={24}>
309- <Title level={5}>Conta criada em: {date}</Title>
310- </Col>
311-
312- {"belt" in info && (
313- <Col span={24}>
314- <Belt belt={info.belt} />
315- </Col>
316- )}
317-
318- <Col span={24}>
319- <Space style={{ fontSize: 20 }}>
320- {info?.socials?.map((social: any) =>
321- social?.name == "discord" || social?.name == "slack" ? (
322- <a title={social.username}>
323- {socials.ICONS[social.name as keyof typeof socials.URLS]}
324- </a>
325- ) : (
326- <a
327- key={social.id}
328- target="_blank"
329- rel="noreferrer"
330- href={`${
331- socials.URLS[social.name as keyof typeof socials.URLS]
332- }/${social.username}` }
333- >
334- {socials.ICONS[social.name as keyof typeof socials.URLS]}
335- </a>
336- )
337- )}
338- </Space>
339- </Col>
340-
341- <Col span={24}>
342- {skills.map((s) => (
343- <Tag key={s.id}>
344- {getIcon(s.name)} {s.name}
345- </Tag>
346- ))}
347- </Col>
348- </Row>
349- </Space>
350- </Row>
351- <Tabs defaultActiveKey="1" centered>
352- <TabPane tab="Eventos" key="1">
353- <Timeline mode="alternate">
354- <Timeline.Item dot={<ClockCircleOutlined />}>
355- Registou-se na plataforma{" "}
356- {moment(info.since).locale("pt").fromNow()}
357- </Timeline.Item>
358- </Timeline>
359- </TabPane>
360- {role === EUser.Ninja && (
361- <TabPane tab="Crachás" key="2">
362- {badges.length == 0 ? (
363- <Empty
364- description="Sem Crachás"
365- image={Empty.PRESENTED_IMAGE_SIMPLE}
366- />
367- ) : (
368- <Row justify="start" align="middle">
369- {badges.map((badge) => (
370- <Col key={badge.id} {...{ xs: 24, md: 12, xl: 8, xxl: 6 }}>
371- <Space>
372- <Badge {...badge} />
373- </Space>
374- </Col>
375- ))}
376- </Row>
377- )}
378- </TabPane>
379- )}
380- <TabPane tab="Projetos" key="3">
381- {projects.length == 0 ? (
382- <Empty
383- description="Sem Projetos"
384- image={Empty.PRESENTED_IMAGE_SIMPLE}
385- />
386- ) : (
387- <Row justify="start" align="middle">
388- {projects.map((project) => (
389- <Col key={project.id} {...{ xs: 24, md: 12, xl: 8, xxl: 6 }}>
390- <Space>
391- <Document {...project} />
392- </Space>
393- </Col>
394- ))}
395- </Row>
396- )}
397- </TabPane>
398- </Tabs> */
399- }
0 commit comments