diff --git a/src/components/AttributionForm/index.tsx b/src/components/AttributionForm/index.tsx deleted file mode 100644 index dab5b7a29d42583ceb5cef276b0bc62ec1465e1a..0000000000000000000000000000000000000000 --- a/src/components/AttributionForm/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -function AttributionForm() { - const teamID = import.meta.env.VITE_TEAM_ID; - - // Listen to size change and update form height - window.addEventListener("message", function (e) { - if (e.origin === "https://teams.igem.org") { - const { type, data } = JSON.parse(e.data); - if (type === "igem-attribution-form") { - const element = document.getElementById("igem-attribution-form"); - if (element) { - element.style.height = `${data + 50}px`; - } - } - } - }); - - return ( - <> - <iframe - style={{ width: "100%" }} - id="igem-attribution-form" - src={`https://teams.igem.org/${teamID}/attributions`} - /> - </> - ); -} - -export default AttributionForm; diff --git a/src/components/Footer/index.tsx b/src/components/Footer.tsx similarity index 98% rename from src/components/Footer/index.tsx rename to src/components/Footer.tsx index e18b2c6b9c81efc228994ee532c9c3ab499fdc0c..ea3ef186cd8948730a0398ee4b0b1a26c618ef3d 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer.tsx @@ -1,6 +1,6 @@ import { stringToSlug } from "../../utils"; -function WikiFooter() { +export function Footer() { const teamYear = import.meta.env.VITE_TEAM_YEAR; const teamName = import.meta.env.VITE_TEAM_NAME; const teamSlug = stringToSlug(teamName); @@ -78,5 +78,3 @@ function WikiFooter() { </footer> ); } - -export default WikiFooter; diff --git a/src/components/Header/index.tsx b/src/components/Header.tsx similarity index 83% rename from src/components/Header/index.tsx rename to src/components/Header.tsx index f5018e3be85a4d60c679409cc2454b40cf78ab85..f599004e3edb8153be3f1d074a67ff51170755b3 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header.tsx @@ -5,7 +5,7 @@ interface HeaderProps { lead: string; } -const WikiHeader: React.FC<HeaderProps> = ({ title, lead }) => { +export function Header({ title, lead }: HeaderProps) { return ( <header className="bg-hero py-5 mb-5"> <div className="container h-100"> @@ -19,5 +19,3 @@ const WikiHeader: React.FC<HeaderProps> = ({ title, lead }) => { </header> ); }; - -export default WikiHeader; diff --git a/src/components/Inspirations/index.tsx b/src/components/Inspirations.tsx similarity index 90% rename from src/components/Inspirations/index.tsx rename to src/components/Inspirations.tsx index 05b9c0af997bf55fdbc05596db113ceb7b4f9be8..3273e3747f653abbdc94077da8d3bac9b38c51e0 100644 --- a/src/components/Inspirations/index.tsx +++ b/src/components/Inspirations.tsx @@ -11,7 +11,7 @@ interface InspirationsProps { inspirationLinkList: InspirationLink[]; } -const Inspirations: React.FC<InspirationsProps> = ({ inspirationLinkList }) => { +export function Inspirations ({ inspirationLinkList }: InspirationsProps) { return ( <> <div className="col-lg-4"> @@ -42,4 +42,3 @@ const Inspirations: React.FC<InspirationsProps> = ({ inspirationLinkList }) => { ); }; -export default Inspirations; diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar.tsx similarity index 96% rename from src/components/Navbar/index.tsx rename to src/components/Navbar.tsx index f295fe2240b42e720b59dc7bf781564f72dccf8b..75a558fa0e23ae6eeaa4c41c72190ebc860d711d 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar.tsx @@ -5,7 +5,7 @@ import NavDropdown from "react-bootstrap/NavDropdown"; import { Link } from "react-router-dom"; import Pages from "../../pages.ts"; -function WikiNavbar() { +export function Navbar() { const pages = Pages.map((item, pageIndex) => { if ("folder" in item && item.folder) { const folderItems = item.folder.map((subpage, subpageIndex) => { @@ -50,6 +50,4 @@ function WikiNavbar() { </Container> </Navbar> ); -} - -export default WikiNavbar; +} \ No newline at end of file diff --git a/src/components/NotFound.tsx b/src/components/NotFound.tsx new file mode 100644 index 0000000000000000000000000000000000000000..e9f8f1237f00cbd6f10a5fbdb20590edbe999233 --- /dev/null +++ b/src/components/NotFound.tsx @@ -0,0 +1,16 @@ +import { Link } from "react-router-dom"; + +export function NotFound() { + return ( + <div className="d-flex flex-column justify-content-center align-items-center"> + <h1 className="not-found-title" style={{ fontSize: "100pt" }}> + 404 + </h1> + <div className="my-5"> + <Link to="/" className="btn btn-secondary btn-lg"> + Back to Home + </Link> + </div> + </div> + ); +} diff --git a/src/components/NotFound/index.tsx b/src/components/NotFound/index.tsx deleted file mode 100644 index 0df78af6a49b8c0b5a00c3ad461fdf4361bb2ea3..0000000000000000000000000000000000000000 --- a/src/components/NotFound/index.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { Link } from "react-router-dom"; - -function NotFound() { - return ( - <> - <div className="d-flex flex-column justify-content-center align-items-center"> - <h1 className="not-found-title" style={{ fontSize: "100pt" }}> - 404 - </h1> - <div className="my-5"> - <Link to="/" className="btn btn-secondary btn-lg"> - Back to Home - </Link> - </div> - </div> - </> - ); -} - -export default NotFound; diff --git a/src/components/index.tsx b/src/components/index.tsx index 9d1501014013d660057b77c2c9bc344864fdc34d..33a5bbde21faeacdb797869cd16ec6ea9f6191f3 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -1,4 +1,5 @@ -export { default as Navbar } from "./Navbar"; -export { default as Header } from "./Header"; -export { default as Footer } from "./Footer"; -export { default as NotFound } from "./NotFound"; +export * from "./Navbar"; +export * from "./Header"; +export * from "./Footer"; +export * from "./NotFound"; +export * from "./Inspirations"; diff --git a/src/containers/App/App.tsx b/src/containers/App/App.tsx index 622d79fe334e501d9b2b25719be5f3f89a4d2a54..f943b49d6b5a51ac7227f83718979e9f05d49727 100644 --- a/src/containers/App/App.tsx +++ b/src/containers/App/App.tsx @@ -2,7 +2,7 @@ import "./App.css"; import "bootstrap/dist/css/bootstrap.min.css"; import { Route, Routes } from "react-router-dom"; import { Footer, Header, Navbar, NotFound } from "../../components"; -import { getPathMapping, stringToSlug, useDocumentTitle } from "../../utils"; +import { getPathMapping, stringToSlug } from "../../utils"; const App = () => { const pathMapping = getPathMapping(); @@ -14,10 +14,12 @@ const App = () => { // Set Page Title const title = currentPath in pathMapping ? pathMapping[currentPath].title : "Not Found"; - useDocumentTitle(title); + + useEffect(() => { + document.title = `${title || ""} | ${import.meta.env.VITE_TEAM_NAME} - iGEM ${import.meta.env.VITE_TEAM_YEAR}`; + }, [title]); return ( - <> <> {/* Navigation */} <Navbar /> @@ -58,7 +60,6 @@ const App = () => { {/* MUST mention license AND have a link to team wiki's repository on gitlab.igem.org */} <Footer /> </> - </> ); }; diff --git a/src/contents/attributions.tsx b/src/contents/attributions.tsx index 11d919f06b1a42685351855f34c5302d5ae6f941..da8826cb5ea08a99d8e69ab730e10ace8a4e5f19 100644 --- a/src/contents/attributions.tsx +++ b/src/contents/attributions.tsx @@ -1,6 +1,26 @@ -import AttributionForm from "../components/AttributionForm"; +import {useEffect} from 'react'; const Attributions = () => { + const teamID = import.meta.env.VITE_TEAM_ID; + + useEffect(() => { + function listenToIframeHeight(e) { + if (e.origin === "https://teams.igem.org") { + const { type, data } = JSON.parse(e.data); + if (type === "igem-attribution-form") { + const element = document.getElementById("igem-attribution-form"); + if (element) { + element.style.height = `${data + 50}px`; + } + } + } + } + window.addEventListener("message", listenToIframeHeight); + return () => { + window.removeEventListener("message", listenToIframeHeight) + } + }, []) + return ( <> <div className="row mt-4"> @@ -31,7 +51,11 @@ const Attributions = () => { </div> </div> </div> - <AttributionForm /> + <iframe + style={{ width: "100%" }} + id="igem-attribution-form" + src={`https://teams.igem.org/${teamID}/attributions`} + /> </> ); }; diff --git a/src/contents/contribution.tsx b/src/contents/contribution.tsx index c515e3c015be38207adb4d638adeb895f40317c2..407a69420f9c8c91ebf819ed6123c6a4d36cdc36 100644 --- a/src/contents/contribution.tsx +++ b/src/contents/contribution.tsx @@ -1,4 +1,4 @@ -const Contribution = () => { +export function Contribution () { return ( <> <div className="row mt-4"> @@ -31,6 +31,4 @@ const Contribution = () => { </div> </> ); -}; - -export default Contribution; +}; \ No newline at end of file diff --git a/src/contents/description.tsx b/src/contents/description.tsx index 8b395b79135687f38c7044c2f844c54b4a77551f..df7abe01ecebb9ee642acc7b06c8f34eaed19930 100644 --- a/src/contents/description.tsx +++ b/src/contents/description.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Description = () => { +export function Description () { const links: InspirationLink[] = [ { year: 2022, teamName: "DTU-Denmark", pageName: "Description" }, { year: 2019, teamName: "ITESO_Guadalajara", pageName: "Description" }, @@ -76,6 +76,4 @@ const Description = () => { </div> </> ); -}; - -export default Description; +}; \ No newline at end of file diff --git a/src/contents/education.tsx b/src/contents/education.tsx index 318341604d50084e14c589d5be608a352bc334a8..09aab1b95b22a5a6e339c3a1f089b743844bb34d 100644 --- a/src/contents/education.tsx +++ b/src/contents/education.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Education = () => { +export function Education () { const links: InspirationLink[] = [ { year: 2020, teamName: "CCA_San_Diego", pageName: "Education" }, { year: 2020, teamName: "Lambert_GA", pageName: "Education" }, @@ -47,5 +47,3 @@ const Education = () => { </> ); }; - -export default Education; diff --git a/src/contents/engineering.tsx b/src/contents/engineering.tsx index 6c1009fb9129707ede525f23c9676dd8b6e83099..42b77b330c546b3ad1c6aa266dfd2fcb403985d0 100644 --- a/src/contents/engineering.tsx +++ b/src/contents/engineering.tsx @@ -1,4 +1,4 @@ -const Engineering = () => { +export function Engineering () { return ( <> <div className="row mt-4"> @@ -31,6 +31,4 @@ const Engineering = () => { </div> </> ); -}; - -export default Engineering; +}; \ No newline at end of file diff --git a/src/contents/entrepreneurship.tsx b/src/contents/entrepreneurship.tsx index 4311330098cdb36e910377667cdc61dbbaa63710..ea385ec4ebea6005ed32d1bf632f71b9531a5a77 100644 --- a/src/contents/entrepreneurship.tsx +++ b/src/contents/entrepreneurship.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Entrepreneurship = () => { +export function Entrepreneurship () { const links: InspirationLink[] = [ { year: 2019, teamName: "UCopenhagen", pageName: "Entrepreneurship" }, { year: 2019, teamName: "Thessaly", pageName: "Entrepreneurship" }, @@ -79,4 +79,3 @@ const Entrepreneurship = () => { ); }; -export default Entrepreneurship; diff --git a/src/contents/experiments.tsx b/src/contents/experiments.tsx index 40a5ee1746d9335840757708ecbaebb43045aee6..70a77e3f0e2cdf262e73e70df690ba1a34c1f93b 100644 --- a/src/contents/experiments.tsx +++ b/src/contents/experiments.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Experiments = () => { +export function Experiments () { const links: InspirationLink[] = [ { year: 2019, teamName: "Nantes", pageName: "Experiments" }, { year: 2019, teamName: "TU_Eindhoven", pageName: "Experiments" }, @@ -31,6 +31,4 @@ const Experiments = () => { </div> </> ); -}; - -export default Experiments; +}; \ No newline at end of file diff --git a/src/contents/hardware.tsx b/src/contents/hardware.tsx index 481ff48ec3a95d2c985450658ceec78fc3d504b9..6b55828b9041cddabbfa60e47d0958d05f9cc4b3 100644 --- a/src/contents/hardware.tsx +++ b/src/contents/hardware.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Hardware = () => { +export function Hardware () { const links: InspirationLink[] = [ { year: 2018, teamName: "Valencia_UPV", pageName: "Hardware" }, { year: 2018, teamName: "Unesp_Brazil", pageName: "Hardware" }, @@ -64,5 +64,3 @@ const Hardware = () => { </> ); }; - -export default Hardware; diff --git a/src/contents/home.tsx b/src/contents/home.tsx index c948e2f05400ab8c8d9da41a861b68fb03985b2a..c2455b58bca91172bfac49670438ba1d62bde81d 100644 --- a/src/contents/home.tsx +++ b/src/contents/home.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Home = () => { +export function Home () { const links: InspirationLink[] = [ { year: 2022, teamName: "DTU-Denmark", pageName: "" }, { year: 2022, teamName: "Virginia", pageName: "" }, @@ -104,6 +104,4 @@ const Home = () => { </div> </> ); -}; - -export default Home; +}; \ No newline at end of file diff --git a/src/contents/human-practices.tsx b/src/contents/human-practices.tsx index 6738b39df21898a9bd0e17555e4e89c0ce76d28a..64242d5b27587f9324cf62f0abbfd9328b3a065a 100644 --- a/src/contents/human-practices.tsx +++ b/src/contents/human-practices.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const HumanPractices = () => { +export function HumanPractices () { const links: InspirationLink[] = [ { year: 2019, teamName: "Thessaly", pageName: "Human_Practices" }, { year: 2019, teamName: "Linkoping_Sweden", pageName: "Human_Practices" }, @@ -108,5 +108,3 @@ const HumanPractices = () => { </> ); }; - -export default HumanPractices; diff --git a/src/contents/inclusivity.tsx b/src/contents/inclusivity.tsx index d90639fab88c7834c97c201b8a1536b275b42923..fe2ca544427aebc1b55f704f600cb7b1b7bed3b6 100644 --- a/src/contents/inclusivity.tsx +++ b/src/contents/inclusivity.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Inclusivity = () => { +export function Inclusivity () { const links: InspirationLink[] = [ { year: 2020, teamName: "Fudan", pageName: "Inclusion" }, { year: 2020, teamName: "CCU_Taiwan", pageName: "Inclusion" }, @@ -65,5 +65,3 @@ const Inclusivity = () => { </> ); }; - -export default Inclusivity; diff --git a/src/contents/index.tsx b/src/contents/index.tsx index f276a5fb231dc4321cc9d6162f0956760db787fb..1070578fe3fee74881c4867951b45e3762c8e4a3 100644 --- a/src/contents/index.tsx +++ b/src/contents/index.tsx @@ -1,25 +1,25 @@ -export { default as Home } from "./home.tsx"; +export * from "./home.tsx"; // Team -export { default as Team } from "./team.tsx"; -export { default as Attributions } from "./attributions.tsx"; +export * from "./team.tsx"; +export * from "./attributions.tsx"; // Project -export { default as Contribution } from "./contribution.tsx"; -export { default as Description } from "./description.tsx"; -export { default as Engineering } from "./engineering.tsx"; -export { default as Experiments } from "./experiments.tsx"; -export { default as Notebook } from "./notebook.tsx"; -export { default as Results } from "./results.tsx"; +export * from "./contribution.tsx"; +export * from "./description.tsx"; +export * from "./engineering.tsx"; +export * from "./experiments.tsx"; +export * from "./notebook.tsx"; +export * from "./results.tsx"; // Safety -export { default as Safety } from "./safety.tsx"; +export * from "./safety.tsx"; // Human Practices -export { default as HumanPractices } from "./human-practices.tsx"; +export * from "./human-practices.tsx"; // Awards -export { default as Education } from "./education.tsx"; -export { default as Entrepreneurship } from "./entrepreneurship.tsx"; -export { default as Hardware } from "./hardware.tsx"; -export { default as Inclusivity } from "./inclusivity.tsx"; -export { default as Measurement } from "./measurement.tsx"; -export { default as Model } from "./model.tsx"; -export { default as Plant } from "./plant.tsx"; -export { default as Software } from "./software.tsx"; -export { default as Sustainable } from "./sustainable.tsx"; +export * from "./education.tsx"; +export * from "./entrepreneurship.tsx"; +export * from "./hardware.tsx"; +export * from "./inclusivity.tsx"; +export * from "./measurement.tsx"; +export * from "./model.tsx"; +export * from "./plant.tsx"; +export * from "./software.tsx"; +export * from "./sustainable.tsx"; diff --git a/src/contents/measurement.tsx b/src/contents/measurement.tsx index 408110252fa0f6ccc7b154a27715825683d348b4..8655b877f2ef59fbb13f64ed0a2ccbd14a84a8b1 100644 --- a/src/contents/measurement.tsx +++ b/src/contents/measurement.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Measurement = () => { +export function Measurement () { const links: InspirationLink[] = [ { year: 2018, teamName: "UC_Davis", pageName: "Measurement" }, { year: 2019, teamName: "Newcastle", pageName: "Measurement" }, @@ -61,5 +61,3 @@ const Measurement = () => { </> ); }; - -export default Measurement; diff --git a/src/contents/model.tsx b/src/contents/model.tsx index 9339f8409cf865576ca5ce53d7762ca1b54236d1..d02b126bd85cf365cf7641775b0426dd41dfc148 100644 --- a/src/contents/model.tsx +++ b/src/contents/model.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Model = () => { +export function Model () { const links: InspirationLink[] = [ { year: 2018, teamName: "GreatBay_China", pageName: "Model" }, { year: 2018, teamName: "Leiden", pageName: "Model" }, @@ -65,6 +65,4 @@ const Model = () => { </div> </> ); -}; - -export default Model; +}; \ No newline at end of file diff --git a/src/contents/notebook.tsx b/src/contents/notebook.tsx index 699affd2ae16e2af49b13f0c3d50bf349aae4640..072a2a82795132c0a07ea7c0bff3dc0a08717291 100644 --- a/src/contents/notebook.tsx +++ b/src/contents/notebook.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Notebook = () => { +export function Notebook () { const links: InspirationLink[] = [ { year: 2018, teamName: "Munich", pageName: "Notebook" }, { year: 2019, teamName: "Georgia_State", pageName: "Notebook" }, @@ -28,6 +28,4 @@ const Notebook = () => { </div> </> ); -}; - -export default Notebook; +}; \ No newline at end of file diff --git a/src/contents/plant.tsx b/src/contents/plant.tsx index 8da479e41f946cd0fe56044b2d26c727db81d1f7..03ad2c891d4e9db2057a448571328aa8d6c81971 100644 --- a/src/contents/plant.tsx +++ b/src/contents/plant.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Plant = () => { +export function Plant () { const links: InspirationLink[] = [ { year: 2018, teamName: "Cardiff_Wales", pageName: "Plant" }, { year: 2019, teamName: "Sorbonne_U_Paris", pageName: "Plant" }, @@ -47,5 +47,3 @@ const Plant = () => { </> ); }; - -export default Plant; diff --git a/src/contents/results.tsx b/src/contents/results.tsx index ee9ff048689a18a31c39de96a9abbad42cc420d5..97655016b9bb281e97e479ccaea8a8fa555c2340 100644 --- a/src/contents/results.tsx +++ b/src/contents/results.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Results = () => { +export function Results () { const links: InspirationLink[] = [ { year: 2019, teamName: "Newcastle", pageName: "Results" }, { year: 2019, teamName: "Munich", pageName: "Results" }, @@ -79,5 +79,3 @@ const Results = () => { </> ); }; - -export default Results; diff --git a/src/contents/safety.tsx b/src/contents/safety.tsx index fb100c515a24c9b979dec510cf9d64e8aeb5aaa7..b342bc4f1133fbfae5024d62ba77c19ef3ae974b 100644 --- a/src/contents/safety.tsx +++ b/src/contents/safety.tsx @@ -1,4 +1,4 @@ -const Safety = () => { +export function Safety () { return ( <> <div className="row mt-4"> @@ -90,5 +90,3 @@ const Safety = () => { </> ); }; - -export default Safety; diff --git a/src/contents/software.tsx b/src/contents/software.tsx index b6be4d31afce622fe35ddab8a36a9c13a2656c24..b78d57b12bbf284ae521e9c46d4bacdb7995ffab 100644 --- a/src/contents/software.tsx +++ b/src/contents/software.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Software = () => { +export function Software () { const links: InspirationLink[] = [ { year: 2019, teamName: "Sydney_Australia", pageName: "Software" }, { year: 2019, teamName: "SMMU-China", pageName: "Software" }, @@ -52,5 +52,3 @@ const Software = () => { </> ); }; - -export default Software; diff --git a/src/contents/sustainable.tsx b/src/contents/sustainable.tsx index 013b7c52cec38c7f1aae01acd371e80ed2619187..8559aa2eb98995de95aa81c1c2f34bd277e894de 100644 --- a/src/contents/sustainable.tsx +++ b/src/contents/sustainable.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Sustainable = () => { +export function Sustainable () { const links: InspirationLink[] = [ { year: 2020, teamName: "Calgary", pageName: "Sustainable" }, { year: 2020, teamName: "Toulouse_INSA-UPS", pageName: "Sustainable" }, @@ -50,6 +50,4 @@ const Sustainable = () => { <Inspirations inspirationLinkList={links} /> </> ); -}; - -export default Sustainable; +}; \ No newline at end of file diff --git a/src/contents/team.tsx b/src/contents/team.tsx index 3dda17926646bcbde8a599951d29c1056dce8f6f..9fd7f2d462b510d5f1b1032ced569639fe76616f 100644 --- a/src/contents/team.tsx +++ b/src/contents/team.tsx @@ -1,6 +1,6 @@ -import Inspirations, { InspirationLink } from "../components/Inspirations"; +import { Inspirations, InspirationLink } from "../components"; -const Team = () => { +export function Team () { const links: InspirationLink[] = [ { year: 2019, teamName: "CU", pageName: "Team" }, { year: 2019, teamName: "UANL", pageName: "Team" }, @@ -78,6 +78,4 @@ const Team = () => { </div> </> ); -}; - -export default Team; +}; \ No newline at end of file diff --git a/src/utils/getPathMapping.ts b/src/utils/getPathMapping.ts index 0c0a6c24f1258ff6f8fac1f5e0f5213747c14440..950d76b02f268cfb4a6c293bc652f4ea2bdefbcd 100644 --- a/src/utils/getPathMapping.ts +++ b/src/utils/getPathMapping.ts @@ -1,6 +1,6 @@ import pages from "../pages.ts"; -const getPathMapping = () => { +export const getPathMapping = () => { return pages.reduce<{ [key: string]: { name: string | undefined; @@ -31,5 +31,3 @@ const getPathMapping = () => { return map; }, {}); }; - -export default getPathMapping; diff --git a/src/utils/index.ts b/src/utils/index.ts index 2e75b30962ec9fbab7337fd424c7d7341a4729e3..feff56aed58d8c088189779ade760b7a610d477d 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,3 +1,2 @@ -export { default as getPathMapping } from "./getPathMapping"; -export { default as useDocumentTitle } from "./useDocumentTitle"; -export { default as stringToSlug } from "./stringToSlug"; +export * from "./getPathMapping"; +export * from "./stringToSlug"; diff --git a/src/utils/stringToSlug.ts b/src/utils/stringToSlug.ts index 97e668d13ff99c1f35f6b89bef92181b492b87a7..3fb7b55ea0fd10e2cdd901c982a323e6b5aa2c1a 100644 --- a/src/utils/stringToSlug.ts +++ b/src/utils/stringToSlug.ts @@ -1,4 +1,4 @@ -export default function stringToSlug(string: string): string { +export function stringToSlug(string: string): string { let slug = String(string).toLowerCase(); slug = slug.replace(/[^a-z0-9-]/g, "-"); slug = slug.replace(/-+/g, "-"); diff --git a/src/utils/useDocumentTitle.ts b/src/utils/useDocumentTitle.ts deleted file mode 100644 index 94d85aa845721efc76496011065bd488ea74f4fb..0000000000000000000000000000000000000000 --- a/src/utils/useDocumentTitle.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { useEffect } from "react"; - -function useDocumentTitle(title: any) { - useEffect(() => { - document.title = `${title || ""} | ${import.meta.env.VITE_TEAM_NAME} - iGEM ${import.meta.env.VITE_TEAM_YEAR}`; - }, [title]); -} - -export default useDocumentTitle;