mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
Port navigation.
This commit is contained in:
45
src/components/ui/Category.tsx
Normal file
45
src/components/ui/Category.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import styled, { css } from "styled-components";
|
||||
import { Children } from "../../types/Preact";
|
||||
import { Plus } from "@styled-icons/feather";
|
||||
|
||||
const CategoryBase = styled.div<Pick<Props, 'variant'>>`
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
|
||||
margin-top: 4px;
|
||||
padding: 6px 10px;
|
||||
margin-bottom: 4px;
|
||||
white-space: nowrap;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
|
||||
svg {
|
||||
stroke: var(--foreground);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
${ props => props.variant === 'uniform' && css`
|
||||
padding-top: 6px;
|
||||
` }
|
||||
`;
|
||||
|
||||
interface Props {
|
||||
text: Children;
|
||||
action?: () => void;
|
||||
variant?: 'default' | 'uniform';
|
||||
}
|
||||
|
||||
export default function Category(props: Props) {
|
||||
return (
|
||||
<CategoryBase>
|
||||
{props.text}
|
||||
{props.action && (
|
||||
<Plus size={16} onClick={props.action} />
|
||||
)}
|
||||
</CategoryBase>
|
||||
);
|
||||
};
|
||||
32
src/components/ui/Header.tsx
Normal file
32
src/components/ui/Header.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import styled, { css } from "styled-components";
|
||||
|
||||
interface Props {
|
||||
background?: boolean;
|
||||
placement: 'primary' | 'secondary'
|
||||
}
|
||||
|
||||
export default styled.div<Props>`
|
||||
height: 56px;
|
||||
font-weight: 600;
|
||||
user-select: none;
|
||||
|
||||
gap: 10px;
|
||||
flex: 0 auto;
|
||||
display: flex;
|
||||
padding: 20px;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
|
||||
background-color: var(--primary-background);
|
||||
background-size: cover !important;
|
||||
background-position: center !important;
|
||||
|
||||
${ props => props.background && css`
|
||||
height: 120px;
|
||||
align-items: flex-end;
|
||||
` }
|
||||
|
||||
${ props => props.placement === 'secondary' && css`
|
||||
padding: 14px;
|
||||
` }
|
||||
`;
|
||||
Reference in New Issue
Block a user