Skip to content

Commit 4b32a2a

Browse files
committed
correct some erros
1 parent 4eb3124 commit 4b32a2a

File tree

2 files changed

+6
-180
lines changed

2 files changed

+6
-180
lines changed

apps/app/components/Profile/index.tsx

Lines changed: 6 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1914
import moment from "moment";
2015
import "moment/locale/pt";
@@ -24,19 +19,13 @@ import Document from "~/components/Document";
2419
import * as api from "bokkenjs";
2520
import * as socials from "~/lib/social";
2621
import { notifyError, notifyInfo } from "~/components/Notification";
27-
import styles from "./style.module.css";
2822
import { EUser, getNinjasAsAdmin, updateGuardianAsAdmin } from "bokkenjs";
29-
30-
import { BsFileEarmarkPersonFill } from "react-icons/bs";
3123
import 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

3726
const { TabPane } = Tabs;
3827

39-
const { Title, Text } = Typography;
28+
const { Title } = Typography;
4029

4130
interface 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

280267
export 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-
}

apps/app/lib/utils.tsx

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -42,45 +42,3 @@ export function getIcon(skill: string) {
4242
return <SiSlack />;
4343
}
4444
}
45-
46-
export function getImg(skill: string) {
47-
switch (skill) {
48-
case "Python":
49-
return (
50-
<img
51-
src="https://raw.githubusercontent.com/devicons/devicon/master/icons/python/python-original.svg"
52-
height="25"
53-
width="25"
54-
alt="Python Logo"
55-
/>
56-
);
57-
case "Scratch":
58-
return <SiScratch style={{ fontSize: "25px" }} />;
59-
case "HTML/CSS/Javascript":
60-
return (
61-
<div style={{ display: "flex" }}>
62-
<img
63-
src="https://raw.githubusercontent.com/devicons/devicon/master/icons/html5/html5-original.svg"
64-
title="HTML"
65-
alt="HTML"
66-
width="25"
67-
height="25"
68-
/>
69-
<img
70-
src="https://raw.githubusercontent.com/devicons/devicon/master/icons/css3/css3-original.svg"
71-
title="CSS"
72-
alt="CSS"
73-
width="25"
74-
height="25"
75-
/>
76-
<img
77-
src="https://raw.githubusercontent.com/devicons/devicon/master/icons/javascript/javascript-original.svg"
78-
title="JavaScript"
79-
alt="JavaScript"
80-
width="25"
81-
height="25"
82-
/>
83-
</div>
84-
);
85-
}
86-
}

0 commit comments

Comments
 (0)