12 changed files with 162 additions and 28 deletions
@ -1,8 +1,9 @@ |
|||||||
export interface ButtonControlProps { |
export interface ButtonControlProps { |
||||||
onClick?: () => void; |
onClick?: () => void; |
||||||
children?: React.ReactNode; |
children?: React.ReactNode; |
||||||
|
className?: string; |
||||||
} |
} |
||||||
|
|
||||||
export function ButtonControl({ onClick, children }: ButtonControlProps) { |
export function ButtonControl({ onClick, children, className }: ButtonControlProps) { |
||||||
return <button onClick={onClick}>{children}</button> |
return <button onClick={onClick} className={className}>{children}</button> |
||||||
} |
} |
||||||
|
|||||||
@ -0,0 +1,18 @@ |
|||||||
|
import { ButtonControlProps, ButtonControl } from "./ButtonControl"; |
||||||
|
import { Icon, Icons } from "components/Icon"; |
||||||
|
|
||||||
|
export interface IconButtonProps extends ButtonControlProps { |
||||||
|
icon: Icons; |
||||||
|
} |
||||||
|
|
||||||
|
export function IconButton(props: IconButtonProps) { |
||||||
|
return ( |
||||||
|
<ButtonControl |
||||||
|
{...props} |
||||||
|
className="flex items-center px-4 py-2 space-x-2 bg-pink-900 text-white rounded-full" |
||||||
|
> |
||||||
|
<Icon icon={props.icon} /> |
||||||
|
<span>{props.children}</span> |
||||||
|
</ButtonControl> |
||||||
|
); |
||||||
|
} |
||||||
@ -1,20 +1,28 @@ |
|||||||
import { ButtonControl } from './Buttons/ButtonControl'; |
import { IconButton } from "./Buttons/IconButton"; |
||||||
import { Icon, Icons } from './Icon'; |
import { Icons } from "./Icon"; |
||||||
import { TextInputControl, TextInputControlPropsNoLabel } from './TextInputs/TextInputControl'; |
import { |
||||||
|
TextInputControl, |
||||||
|
TextInputControlPropsNoLabel, |
||||||
|
} from "./TextInputs/TextInputControl"; |
||||||
|
|
||||||
export interface SearchBarProps extends TextInputControlPropsNoLabel { |
export interface SearchBarProps extends TextInputControlPropsNoLabel { |
||||||
buttonText?: string; |
buttonText?: string; |
||||||
onClick?: () => void; |
onClick?: () => void; |
||||||
|
placeholder?: string; |
||||||
} |
} |
||||||
|
|
||||||
export function SearchBarInput(props: SearchBarProps) { |
export function SearchBarInput(props: SearchBarProps) { |
||||||
return ( |
return ( |
||||||
<div> |
<div className="flex items-center space-x-4 pl-8 pr-2 py-2 bg-dink-500 rounded-full"> |
||||||
<TextInputControl onChange={props.onChange} value={props.value} /> |
<TextInputControl |
||||||
<ButtonControl onClick={props.onClick}> |
onChange={props.onChange} |
||||||
<Icon icon={Icons.SEARCH} /> |
value={props.value} |
||||||
{ props.buttonText || "Search" } |
className="placeholder-dink-150 bg-transparent flex-1 focus:outline-none text-white" |
||||||
</ButtonControl> |
placeholder={props.placeholder} |
||||||
|
/> |
||||||
|
<IconButton icon={Icons.SEARCH} onClick={props.onClick}> |
||||||
|
{props.buttonText || "Search"} |
||||||
|
</IconButton> |
||||||
</div> |
</div> |
||||||
) |
); |
||||||
} |
} |
||||||
|
|||||||
@ -0,0 +1,24 @@ |
|||||||
|
import { Icon, Icons } from "components/Icon"; |
||||||
|
import { ReactNode } from "react"; |
||||||
|
|
||||||
|
interface SectionHeadingProps { |
||||||
|
icon?: Icons; |
||||||
|
title: string; |
||||||
|
children?: ReactNode; |
||||||
|
} |
||||||
|
|
||||||
|
export function SectionHeading(props: SectionHeadingProps) { |
||||||
|
return ( |
||||||
|
<div className="mt-12"> |
||||||
|
<p className="flex items-center uppercase font-bold text-dink-300 mb-3"> |
||||||
|
{props.icon ? ( |
||||||
|
<span className="text-xl mr-2"> |
||||||
|
<Icon icon={props.icon} /> |
||||||
|
</span> |
||||||
|
) : null} |
||||||
|
{props.title} |
||||||
|
</p> |
||||||
|
{props.children} |
||||||
|
</div> |
||||||
|
); |
||||||
|
} |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
import { ReactNode } from "react"; |
||||||
|
|
||||||
|
interface ThinContainerProps { |
||||||
|
classNames?: string, |
||||||
|
children?: ReactNode, |
||||||
|
} |
||||||
|
|
||||||
|
export function ThinContainer(props: ThinContainerProps) { |
||||||
|
return (<div className={`max-w-[600px] mx-auto ${props.classNames || ""}`}> |
||||||
|
{props.children} |
||||||
|
</div>) |
||||||
|
} |
||||||
@ -1,3 +1,8 @@ |
|||||||
@tailwind base; |
@tailwind base; |
||||||
@tailwind components; |
@tailwind components; |
||||||
@tailwind utilities; |
@tailwind utilities; |
||||||
|
|
||||||
|
html, |
||||||
|
body { |
||||||
|
@apply min-h-screen bg-dink-900 text-white font-open-sans; |
||||||
|
} |
||||||
|
|||||||
@ -1,7 +1,22 @@ |
|||||||
module.exports = { |
module.exports = { |
||||||
content: ["./src/**/*.{js,jsx,ts,tsx}"], |
content: ["./src/**/*.{js,jsx,ts,tsx}"], |
||||||
theme: { |
theme: { |
||||||
extend: {}, |
extend: { |
||||||
|
colors: { |
||||||
|
"dink-900": "#131119", |
||||||
|
"dink-500": "#252037", |
||||||
|
"dink-400": "#231F34", |
||||||
|
"dink-300": "#70688B", |
||||||
|
"dink-200": "#3A364D", |
||||||
|
"dink-150": "#8F87AB", |
||||||
|
"dink-100": "#393447", |
||||||
|
bink: "#D588E3", |
||||||
|
"pink-900": "#412B57", |
||||||
|
}, |
||||||
|
fontFamily: { |
||||||
|
"open-sans": "'Open Sans'", |
||||||
|
}, |
||||||
|
}, |
||||||
}, |
}, |
||||||
plugins: [], |
plugins: [], |
||||||
}; |
}; |
||||||
|
|||||||
Loading…
Reference in new issue