Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: begin refactoring away from json content files #2115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions packages/website/components/layout/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import React from 'react';
import clsx from 'clsx';

import GradientBackground from '../gradientbackground/gradientbackground';
import TextBlock from '../textblock/textblock';

/**
*
* @param {Object} props
* @param {React.ReactNode} props.children
* @param {string} [props.variant]
* @param {string} [props.id]
*
* @returns
*/
export function Sectionals({ children, variant, id }) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing code used the name "sectionals," and then each of these contained a number of "sectional" components, and within "sectional" you'll find "column." The naming needs a little help, I think, and I'm open to ideas. Maybe "Container" for the outermost box, then "Section," and then "Column"?

return (
<div className="sectionals" id={id}>
{variant && <GradientBackground variant={variant} />}

{children}
</div>
);
}

/**
* @param {Object} props
* @param {React.ReactNode} props.children
* @param {string} [props.id]
* @param {string} [props.className]
*
* @returns
*/
export function Sectional({ children, id, className }) {
return (
<section id={id} className="sectional">
<div className={clsx(className)}>{children}</div>
</section>
);
}

/**
* @param {Object} props
* @param {React.ReactNode} props.children
* @param {string} [props.className]
* @param {string} [props.pushLeft]
* @param {string} [props.pushRight]
*
* @returns
*/
export function Column({ children, className, pushLeft, pushRight }) {
return (
<div className={clsx(className)} data-push-left={pushLeft} data-push-right={pushRight}>
<div className="column-content">{children}</div>
</div>
);
}

/**
* @param {Object} props
* @param {string} props.id
* @param {Object} props.textBlock
* @param {React.ReactNode} props.header
*
* @returns
*/
export function Hero({ id, textBlock, header }) {
return (
<div id={`${id}_hero-container`}>
<div className={`${id}_hero-top-section`}>
<div className={`${id}_hero-artwork-container`}>{header}</div>

<TextBlock block={textBlock} />
</div>
</div>
);
}
Loading