forked from Archives/Athou_commafeed
add css classes to elements to ease css customization
This commit is contained in:
@@ -187,7 +187,7 @@ export function FeedEntry(props: FeedEntryProps) {
|
||||
<Box className={classes.body}>
|
||||
<FeedEntryBody entry={props.entry} />
|
||||
</Box>
|
||||
<Divider variant="dashed" my={paddingY} />
|
||||
<Divider variant="dashed" my={paddingY} className="cf-footer-divider" />
|
||||
<FeedEntryFooter entry={props.entry} />
|
||||
</Box>
|
||||
)}
|
||||
|
||||
@@ -37,7 +37,7 @@ export function FeedEntryFooter(props: FeedEntryFooterProps) {
|
||||
)
|
||||
|
||||
return (
|
||||
<Group justify="space-between">
|
||||
<Group justify="space-between" className="cf-footer">
|
||||
<Group gap={spacing}>
|
||||
{props.entry.markable && (
|
||||
<ActionButton
|
||||
|
||||
@@ -29,8 +29,8 @@ export function FeedEntryHeader(props: FeedEntryHeaderProps) {
|
||||
read: props.entry.read,
|
||||
})
|
||||
return (
|
||||
<Box>
|
||||
<Flex align="flex-start" justify="space-between">
|
||||
<Box className="cf-header">
|
||||
<Flex align="flex-start" justify="space-between" className="cf-header-title">
|
||||
<Flex align="flex-start" className={classes.main}>
|
||||
{props.showStarIcon && (
|
||||
<Box ml={-5}>
|
||||
@@ -41,7 +41,7 @@ export function FeedEntryHeader(props: FeedEntryHeaderProps) {
|
||||
</Flex>
|
||||
{props.showExternalLinkIcon && <OpenExternalLink entry={props.entry} />}
|
||||
</Flex>
|
||||
<Flex align="center">
|
||||
<Flex align="center" className="cf-header-subtitle">
|
||||
<FeedFavicon url={props.entry.iconUrl} />
|
||||
<Space w={6} />
|
||||
<Box c="dimmed">
|
||||
@@ -51,7 +51,7 @@ export function FeedEntryHeader(props: FeedEntryHeaderProps) {
|
||||
</Box>
|
||||
</Flex>
|
||||
{props.expanded && (
|
||||
<Box c="dimmed">
|
||||
<Box className="cf-header-details">
|
||||
{props.entry.author && <span>by {props.entry.author}</span>}
|
||||
{props.entry.author && props.entry.categories && <span> · </span>}
|
||||
{props.entry.categories && <span>{props.entry.categories}</span>}
|
||||
|
||||
@@ -42,11 +42,14 @@ function HeaderToolbar(props: { children: React.ReactNode }) {
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
}}
|
||||
className="cf-toolbar"
|
||||
>
|
||||
{props.children}
|
||||
</Box>
|
||||
) : (
|
||||
<Group gap={spacing}>{props.children}</Group>
|
||||
<Group gap={spacing} className="cf-toolbar">
|
||||
{props.children}
|
||||
</Group>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -75,7 +78,7 @@ export function Header() {
|
||||
|
||||
if (!settings) return <Loader />
|
||||
return (
|
||||
<Center>
|
||||
<Center className="cf-toolbar-wrapper">
|
||||
<HeaderToolbar>
|
||||
<ActionButton
|
||||
icon={<TbArrowUp size={iconSize} />}
|
||||
|
||||
@@ -68,18 +68,18 @@ export function TreeNode(props: TreeNodeProps) {
|
||||
<Box
|
||||
py={1}
|
||||
pl={props.level * 20}
|
||||
className={classes.node}
|
||||
className={`${classes.node} cf-treenode`}
|
||||
onClick={(e: React.MouseEvent) => props.onClick(e, props.id)}
|
||||
data-id={props.id}
|
||||
data-type={props.type}
|
||||
data-unread-count={props.unread}
|
||||
>
|
||||
<Box mr={6} onClick={(e: React.MouseEvent) => props.onIconClick?.(e, props.id)}>
|
||||
<Box mr={6} onClick={(e: React.MouseEvent) => props.onIconClick?.(e, props.id)} className="cf-treenode-icon">
|
||||
<Center>{typeof props.icon === "string" ? <FeedFavicon url={props.icon} /> : props.icon}</Center>
|
||||
</Box>
|
||||
<Box className={classes.nodeText}>{props.name}</Box>
|
||||
{!props.expanded && (
|
||||
<Box>
|
||||
<Box className="cf-treenode-unread-count">
|
||||
<UnreadCount unreadCount={props.unread} />
|
||||
</Box>
|
||||
)}
|
||||
|
||||
@@ -18,7 +18,7 @@ export function UnreadCount(props: { unreadCount: number }) {
|
||||
const count = props.unreadCount >= 10000 ? "10k+" : props.unreadCount
|
||||
return (
|
||||
<Tooltip label={props.unreadCount} disabled={props.unreadCount === count} openDelay={Constants.tooltip.delay}>
|
||||
<Badge className={classes.badge} variant="light" fullWidth>
|
||||
<Badge className={`${classes.badge} cf-badge`} variant="light" fullWidth>
|
||||
{count}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
|
||||
@@ -35,9 +35,16 @@ interface LayoutProps {
|
||||
function LogoAndTitle() {
|
||||
const dispatch = useAppDispatch()
|
||||
return (
|
||||
<Center inline onClick={async () => await dispatch(redirectToRootCategory())} style={{ cursor: "pointer" }}>
|
||||
<Logo size={24} />
|
||||
<Title order={3} pl="md">
|
||||
<Center
|
||||
className="cf-logo-title"
|
||||
inline
|
||||
onClick={async () => await dispatch(redirectToRootCategory())}
|
||||
style={{ cursor: "pointer" }}
|
||||
>
|
||||
<Box className="cf-logo">
|
||||
<Logo size={24} />
|
||||
</Box>
|
||||
<Title order={3} pl="md" className="cf-title">
|
||||
CommaFeed
|
||||
</Title>
|
||||
</Center>
|
||||
|
||||
Reference in New Issue
Block a user