Skip to content

Commit

Permalink
Solution v 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasyl Zhyliakov committed Nov 28, 2024
1 parent 2da4339 commit d6722dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/OnePerson.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Link, useParams } from 'react-router-dom';
import { Person } from '../types';
import classNames from 'classnames';
import { Gender } from '../types/gender';

type Props = {
person: Person;
Expand All @@ -23,7 +24,7 @@ export const OnePerson: React.FC<Props> = ({

const parent = people.find(p => p.name === parentName);

if (parent && parent.sex === 'f') {
if (parent && parent.sex === Gender.female) {
return (
<Link
to={`../${parent.slug}?${searchParams.toString()}`}
Expand All @@ -34,7 +35,7 @@ export const OnePerson: React.FC<Props> = ({
);
}

if (parent && parent.sex === 'm') {
if (parent && parent.sex === Gender.male) {
return (
<Link to={`../${parent.slug}?${searchParams.toString()}`}>
{parent.name}
Expand Down

0 comments on commit d6722dc

Please sign in to comment.