refactor: repo (#1070)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { FunctionComponent } from 'react'
|
||||
|
||||
export const Title: FunctionComponent = ({ children }) => (
|
||||
<>
|
||||
<h2 className="text-base m-0 mb-1 info">{children}</h2>
|
||||
<div className="min-h-2" />
|
||||
</>
|
||||
)
|
||||
|
||||
export const Subtitle: FunctionComponent<{ className?: string }> = ({ children, className = '' }) => (
|
||||
<h4 className={`font-medium text-sm m-0 mb-1 ${className}`}>{children}</h4>
|
||||
)
|
||||
|
||||
export const SubtitleLight: FunctionComponent<{ className?: string }> = ({ children, className = '' }) => (
|
||||
<h4 className={`font-normal text-sm m-0 mb-1 ${className}`}>{children}</h4>
|
||||
)
|
||||
|
||||
export const Text: FunctionComponent<{ className?: string }> = ({ children, className = '' }) => (
|
||||
<p className={`${className} text-xs`}>{children}</p>
|
||||
)
|
||||
|
||||
const buttonClasses =
|
||||
'block bg-default color-text rounded border-solid \
|
||||
border-1 px-4 py-1.75 font-bold text-sm fit-content \
|
||||
focus:bg-contrast hover:bg-contrast border-main'
|
||||
|
||||
export const LinkButton: FunctionComponent<{
|
||||
label: string
|
||||
link: string
|
||||
className?: string
|
||||
}> = ({ label, link, className }) => (
|
||||
<a target="_blank" className={`${className} ${buttonClasses}`} href={link}>
|
||||
{label}
|
||||
</a>
|
||||
)
|
||||
@@ -0,0 +1,28 @@
|
||||
import Icon from '@/Components/Icon/Icon'
|
||||
import { FunctionComponent } from 'react'
|
||||
import { IconType } from '@standardnotes/snjs'
|
||||
|
||||
interface Props {
|
||||
iconType: IconType
|
||||
label: string
|
||||
selected: boolean
|
||||
hasBubble?: boolean
|
||||
onClick: () => void
|
||||
}
|
||||
|
||||
const PreferencesMenuItem: FunctionComponent<Props> = ({ iconType, label, selected, onClick, hasBubble }) => (
|
||||
<div
|
||||
className={`preferences-menu-item select-none ${selected ? 'selected' : ''}`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault()
|
||||
onClick()
|
||||
}}
|
||||
>
|
||||
<Icon className="icon" type={iconType} />
|
||||
<div className="min-w-1" />
|
||||
{label}
|
||||
{hasBubble && <span className="ml-1 color-warning">⚠️</span>}
|
||||
</div>
|
||||
)
|
||||
|
||||
export default PreferencesMenuItem
|
||||
@@ -0,0 +1,7 @@
|
||||
import { FunctionComponent } from 'react'
|
||||
|
||||
const PreferencesGroup: FunctionComponent = ({ children }) => (
|
||||
<div className="bg-default border-1 border-solid rounded border-main px-6 py-6 flex flex-col mb-3">{children}</div>
|
||||
)
|
||||
|
||||
export default PreferencesGroup
|
||||
@@ -0,0 +1,14 @@
|
||||
import { FunctionComponent } from 'react'
|
||||
|
||||
const PreferencesPane: FunctionComponent = ({ children }) => (
|
||||
<div className="color-foreground flex-grow flex flex-row overflow-y-auto min-h-0">
|
||||
<div className="flex-grow flex flex-col py-6 items-center">
|
||||
<div className="w-125 max-w-125 flex flex-col">
|
||||
{children != undefined && Array.isArray(children) ? children.filter((child) => child != undefined) : children}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-basis-55 flex-shrink" />
|
||||
</div>
|
||||
)
|
||||
|
||||
export default PreferencesPane
|
||||
@@ -0,0 +1,10 @@
|
||||
import { FunctionComponent } from 'react'
|
||||
|
||||
type Props = {
|
||||
classes?: string
|
||||
}
|
||||
const PreferencesSegment: FunctionComponent<Props> = ({ children, classes = '' }) => (
|
||||
<div className={`flex flex-col ${classes}`}>{children}</div>
|
||||
)
|
||||
|
||||
export default PreferencesSegment
|
||||
Reference in New Issue
Block a user