Skip to content

Commit

Permalink
Reuse types from social link icon component
Browse files Browse the repository at this point in the history
  • Loading branch information
kilemensi committed Jun 27, 2024
1 parent 9b23945 commit 8357018
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import React, { ForwardedRef } from "react";

import NavBarNavList from "@/roboshield/components/NavBarNavList";
import NextImageButton from "@/roboshield/components/NextImageButton";

interface SocialLinks {
platform: string;
url: string;
}
import type { SocialMediaLink } from "@/roboshield/components/SocialMediaLinkIcon";

interface Menu {
label: string;
Expand All @@ -16,7 +12,7 @@ interface Menu {
interface Props extends Grid2Props {
logo: any;
menus: Menu[];
socialLinks: SocialLinks[];
socialLinks: SocialMediaLink[];
}
const DesktopNavBar = React.forwardRef(function DesktopNavBar(
props: Props,
Expand Down
3 changes: 2 additions & 1 deletion apps/roboshield/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import RichText from "@/roboshield/components/RichText";
import type { Children } from "@/roboshield/components/RichText";
import FooterDescription from "./FooterDescription";
import { Partner } from "@/roboshield/lib/data/payload.types";
import type { SocialMediaLink } from "@/roboshield/components/SocialMediaLinkIcon";

export interface FooterProps {
connect: {
links: { url: string; platform: string }[];
links: SocialMediaLink[];
title: string;
};
description: Children;
Expand Down
8 changes: 2 additions & 6 deletions apps/roboshield/src/components/MobileNavBar/MobileNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ import menuIcon from "@/roboshield/assets/icons/menu-icon.svg";
import CloseIcon from "@/roboshield/assets/icons/Type=x, Size=24, Color=CurrentColor.svg";
import NavBarNavList from "@/roboshield/components/NavBarNavList";
import NextImageButton from "@/roboshield/components/NextImageButton";

interface SocialLinks {
platform: string;
url: string;
}
import type { SocialMediaLink } from "@/roboshield/components/SocialMediaLinkIcon";

interface Menu {
label: string;
Expand All @@ -28,7 +24,7 @@ interface Menu {
interface Props extends Grid2Props {
logo: any;
menus: Menu[];
socialLinks: SocialLinks[];
socialLinks: SocialMediaLink[];
}

const DialogContainer = styled(Dialog)(({ theme: { palette, spacing } }) => ({
Expand Down
8 changes: 2 additions & 6 deletions apps/roboshield/src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import React from "react";

import DesktopNavBar from "@/roboshield/components/DesktopNavBar";
import MobileNavBar from "@/roboshield/components/MobileNavBar";

interface SocialLinks {
platform: string;
url: string;
}
import type { SocialMediaLink } from "@/roboshield/components/SocialMediaLinkIcon";

interface Menu {
label: string;
Expand All @@ -16,7 +12,7 @@ interface Menu {
interface Props {
logo: any;
menus: Menu[];
socialLinks: SocialLinks[];
socialLinks: SocialMediaLink[];
}
function NavBar({ logo, menus, socialLinks }: Props) {
return (
Expand Down
11 changes: 3 additions & 8 deletions apps/roboshield/src/components/Page/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import React from "react";

import type { FooterProps } from "@/roboshield/components/Footer";
import Footer from "@/roboshield/components/Footer";

import type { FooterProps } from "@/roboshield/components/Footer";
import NavBar from "@/roboshield/components/NavBar";

interface SocialLinks {
platform: string;
url: string;
}
import type { SocialMediaLink } from "@/roboshield/components/SocialMediaLinkIcon";

interface Menu {
label: string;
Expand All @@ -23,7 +18,7 @@ interface Menu {
interface Navbar {
logo: any;
menus: Menu[];
socialLinks: SocialLinks[];
socialLinks: SocialMediaLink[];
}
interface Footer {
logo: any;
Expand Down

0 comments on commit 8357018

Please sign in to comment.