Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nomenclature in register page #212

Merged
merged 13 commits into from
Dec 4, 2023
6 changes: 3 additions & 3 deletions apps/app/components/LectureForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ export default function LectureForm({ id }) {

let promise;

const fetchData = () => {
const fetchData = useCallback(() => {
if (!promise) {
promise = Promise.all(events.map((event) => getNinjaEvents(event.id)));
}
return promise;
};
});

useEffect(() => {
fetchData().then((responses) => {
Expand All @@ -71,7 +71,7 @@ export default function LectureForm({ id }) {
)
);
});
}, [events]);
}, [events, fetchData]);

const [filteredNinjas, setFilteredNinjas] = useState([]);
const handleEventChange = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Form,
Input,
Radio,
Space,
Tooltip,
Typography,
} from "antd";
Expand All @@ -15,21 +16,19 @@ import {
MailOutlined,
} from "@ant-design/icons";
import { useAuth } from "@coderdojobraga/ui";
import Koi from "~/components/Koi";

import styles from "./style.module.css";

function Signup() {
const { Title, Text } = Typography;
const { errors, isLoading, sign_up } = useAuth();

const [size, setSize] = useState("");

const handleSizeChange = (e) => {
const handleSizeChange = (e: any) => {
setSize(e.target.value);
};

const onFinish = ({ email, password, role }) => {
const onFinish = ({ email, password, role }: any) => {
sign_up({ email, password, role });
};

Expand Down Expand Up @@ -73,26 +72,35 @@ function Signup() {
},
]}
>
<Radio.Group
className={styles.select}
value={size}
onChange={handleSizeChange}
>
<Radio.Button className={styles.option} value="guardian">
Guardião
</Radio.Button>
<Radio.Button className={styles.option} value="mentor">
Mentor
</Radio.Button>
<Tooltip
className={styles.option}
title="Inicia sessão como Guardião para inscreveres um Ninja"
>
<Radio.Button disabled>
Ninja &#160;
<InfoCircleOutlined />
</Radio.Button>
</Tooltip>
<Radio.Group value={size} onChange={handleSizeChange}>
<Space direction="vertical">
<Radio value="guardian" className="mb-2">
Guardião
<label id="mentor-description" className="ml-2 text-gray-500">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Guardião
<label id="mentor-description" className="ml-2 text-gray-500">
<span className="inline-block w-20">Guardião</span>
<label id="mentor-description" className="text-gray-500">

Responsável da criança.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Muda para "Responsável pela criança"

</label>
</Radio>

<Radio value="mentor" className="mb-2">
Mentor
<label id="mentor-description" className="ml-5 text-gray-500">
Voluntário pela iniciativa.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Muda para "Voluntário na organização"

</label>
</Radio>

<Tooltip
className={styles.option}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
className={styles.option}

title="Inicia sessão como Guardião para inscreveres um Ninja"
>
<Radio disabled value="1">
Ninja
<label id="mentor-description" className="ml-8 text-gray-500">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ninja
<label id="mentor-description" className="ml-8 text-gray-500">
<span className="inline-block w-20">Ninja</span>
<label id="mentor-description" className="text-gray-500">

Criança participante. &nbsp;
</label>
<InfoCircleOutlined />
</Radio>
</Tooltip>
</Space>
</Radio.Group>
</Form.Item>

Expand Down Expand Up @@ -124,7 +132,7 @@ function Signup() {
<Form.Item
className={styles.button}
validateStatus={errors && "error"}
help={errors?.email && "Email já registado"}
help={!errors || "Email já registado"}
>
<Button
type="primary"
Expand Down
27 changes: 13 additions & 14 deletions apps/app/pages/admin/lectures/presences/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default function Presences() {
const [selectedLectures, setSelectedLectures] = useState<Lecture[]>([]);
const [locations, setLocations] = useState<any[]>([]);
const router = useRouter();

const onFinish = (values: any, lectureId: string) => {
api
.updateLecture(lectureId, values)
Expand Down Expand Up @@ -98,7 +99,7 @@ export default function Presences() {
key: lecture.id,
});
});
}, []);
}, [selectedLectures, data]);

useEffect(() => {
api
Expand All @@ -111,19 +112,6 @@ export default function Presences() {
);
});
}, []);

useEffect(() => {
if (selectedEvent !== "") {
setSelectedLectures(
lectures.filter((lecture) => lecture.event.id === selectedEvent)
);
}
}, [selectedEvent, lectures]);

useEffect(() => {
generateData();
}, [selectedLectures]);

const generateData = () => {
const data: any[] = [];

Expand All @@ -141,6 +129,17 @@ export default function Presences() {

setData(data);
};
useEffect(() => {
if (selectedEvent !== "") {
setSelectedLectures(
lectures.filter((lecture) => lecture.event.id === selectedEvent)
);
}
}, [selectedEvent, lectures]);

useEffect(() => {
generateData();
}, [selectedLectures, generateData]);

const handleEditButtonClick = () => {
setEditButtonVisible(false);
Expand Down