Skip to content

Commit

Permalink
feat: project sidebar title using Text
Browse files Browse the repository at this point in the history
  • Loading branch information
1emu committed May 20, 2024
1 parent 40e0311 commit c63118f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/components/Common/Typography/Text.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
font-stretch: normal;
}

.Text.Text--uppercase {
text-transform: uppercase;
}

.Text.Text--size-xs {
font-size: 11px;
line-height: 16px;
Expand Down
3 changes: 3 additions & 0 deletions src/components/Common/Typography/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface Props {
style?: FontStyle
as?: 'span'
title?: string
uppercase?: boolean
}

const Text = React.forwardRef<HTMLParagraphElement, Props>(
Expand All @@ -35,6 +36,7 @@ const Text = React.forwardRef<HTMLParagraphElement, Props>(
className,
as,
title,
uppercase = false,
},
ref
) => {
Expand All @@ -44,6 +46,7 @@ const Text = React.forwardRef<HTMLParagraphElement, Props>(
`Text--weight-${weight}`,
`Text--color-${color}`,
`Text--style-${style}`,
uppercase && `Text--uppercase`,
className
)
const Component = as ?? 'p'
Expand Down
8 changes: 4 additions & 4 deletions src/components/GrantRequest/PersonnelView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { useMemo } from 'react'

import useFormatMessage from '../../hooks/useFormatMessage'
import { TeamMember } from '../../types/grants'
import ProposalMarkdown from '../Proposal/View/ProposalMarkdown'
import EditableBreakdownContent from '../Projects/EditableBreakdownContent.tsx'
import ExpandableBreakdownItem from '../Projects/ExpandableBreakdownItem.tsx'
import ProjectSidebarTitle from '../Projects/ProjectSidebarTitle.tsx'

import { BreakdownItem } from './BreakdownAccordion'
import EditableBreakdownContent from './EditableBreakdownContent.tsx'
import ExpandableBreakdownItem from './ExpandableBreakdownItem.tsx'

interface Props {
members: TeamMember[]
Expand All @@ -26,7 +26,7 @@ function PersonnelView({ members }: Props) {

return (
<>
<ProposalMarkdown text={`## ${t('page.proposal_view.grant.personnel_title')}`} />
<ProjectSidebarTitle text={t('page.proposal_view.grant.personnel_title')} />
{items.map((item, key) => {
return <ExpandableBreakdownItem key={key} item={item} />
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
align-items: center;
justify-content: space-between;
background: var(--white-900);
margin-bottom: 23px;
margin-bottom: 16px;
padding: 16px;
min-height: 64px;
border: 1px solid var(--black-300);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react'

import classNames from 'classnames'

import ChevronRightCircleOutline from '../Icon/ChevronRightCircleOutline'
import ChevronRightCircleOutline from '../Icon/ChevronRightCircleOutline.tsx'

import './ExpandableBreakdownItem.css'

Expand Down
17 changes: 17 additions & 0 deletions src/components/Projects/ProjectSidebarTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Text from '../Common/Typography/Text.tsx'

interface Props {
text: string
}

function ProjectSidebarTitle({ text }: Props) {
return (
<>
<Text size="sm" color="default" weight="semi-bold" uppercase>
{text}
</Text>
</>
)
}

export default ProjectSidebarTitle

0 comments on commit c63118f

Please sign in to comment.