Skip to content

Commit

Permalink
refactor: canonical link seo
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavomorinaga committed Oct 25, 2022
1 parent e9069f0 commit 449fdda
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
19 changes: 12 additions & 7 deletions src/components/User/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function UserComponent({ user, constraintsRef }: IUserProps): JSX
<WrapItem>
<Badge
variant="solid"
colorScheme="green"
bgColor="green.700"
display="flex"
alignItems="center"
gap="1"
Expand All @@ -100,15 +100,15 @@ export default function UserComponent({ user, constraintsRef }: IUserProps): JSX
<FiUsers />
<HStack divider={<Text mx="1">·</Text>}>
<HStack>
<Text fontSize="sm">
<Text fontSize="sm" color="white">
<Text as="strong">{user.followers}</Text>
<Text as="span" textTransform="none" fontWeight="normal" ml="1">
followers
</Text>
</Text>
</HStack>
<HStack>
<Text fontSize="sm">
<Text fontSize="sm" color="white">
<Text as="strong">{user.following}</Text>
<Text as="span" textTransform="none" fontWeight="normal" ml="1">
following
Expand All @@ -121,14 +121,14 @@ export default function UserComponent({ user, constraintsRef }: IUserProps): JSX
<WrapItem>
<Badge
variant="solid"
colorScheme="yellow"
bgColor="yellow.700"
display="flex"
alignItems="center"
gap="1"
borderRadius="md"
>
<FiBook />
<Text as="strong" fontSize="sm">
<Text as="strong" fontSize="sm" color="white">
{user.public_repos}
</Text>
</Badge>
Expand All @@ -137,14 +137,19 @@ export default function UserComponent({ user, constraintsRef }: IUserProps): JSX
<WrapItem>
<Badge
variant="solid"
colorScheme="blue"
bgColor="blue.700"
display="flex"
alignItems="center"
gap="1"
borderRadius="md"
>
<FiMapPin />
<Text fontSize="sm" textTransform="none" fontWeight="normal">
<Text
fontSize="sm"
color="white"
textTransform="none"
fontWeight="normal"
>
{user.location}
</Text>
</Badge>
Expand Down
1 change: 1 addition & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default class Document extends NextDocument {
<Html lang="en">
<Head>
<link rel="manifest" href="/site.webmanifest" />
<link rel="canonical" href="https://next-plate.vercel.app" />
<link
href="/static/icons/icon-16x16.png"
rel="icon"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/user/[login].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ export default function UserPage() {
}, [addUser, user]);

const handleLogin = () => {
if (user) return `👤 ${login} profile`;
if (user) return `${login} profile`;
if (isLoading) return 'Loading...';
if (isError) return 'Not Found!';

// --- Using SWR ---
//
// return user && !error ? `👤 ${login} profile` : !error ? 'Loading...' : 'Not Found!';
// return user && !error ? `${login} profile` : !error ? 'Loading...' : 'Not Found!';
};

return (
Expand Down

0 comments on commit 449fdda

Please sign in to comment.