Skip to content

Components

Tyler Ruff edited this page Aug 26, 2023 · 4 revisions

Each component is located within a directory (along with supporting resources) named after the component. The main component is exported from an index.tsx file. The frontend components in an Ice project should follow the Fire standards for React ((read more)[https://github.com/blazed-space/fire-react]).

Data

All interfaces, enums, and local supporting data is placed in a "data.ts" file.

Example Component

  • /components/header
  • index.tsx
     "use client"
     import Logo from './logo';
     import Burger from './burger';
     export default function Header(){
       let isActive = false;
       return (
        <div>
         <Logo />
         <nav>
           ...
         </nav>
         <Burger active={isActive} />
        </div>
       );
     }
  • logo.tsx
 export default function Logo(){
  return (
   <a>
    ...
   </a>
  );
 }
  • burger.tsx
 import { IBurger } from './data';
 export default function Burger(props: IBurger){
  return (
   <a>
    ...
   </a>
  );
 }
  • data.ts
export interface IBurger{
  active: boolean
}
Clone this wiki locally