Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release single column standups #10471

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 6 additions & 30 deletions packages/client/components/TeamPrompt/TeamPromptResponseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,21 @@ import {mergeRefs} from '../../utils/react/mergeRefs'
import Avatar from '../Avatar/Avatar'
import PlainButton from '../PlainButton/PlainButton'
import PromptResponseEditor from '../promptResponse/PromptResponseEditor'
import {ResponseCardDimensions, ResponsesGridBreakpoints} from './TeamPromptGridDimensions'
import {ResponseCardDimensions} from './TeamPromptGridDimensions'
import TeamPromptLastUpdatedTime from './TeamPromptLastUpdatedTime'
import TeamPromptRepliesAvatarList from './TeamPromptRepliesAvatarList'
import {TeamPromptResponseEmojis} from './TeamPromptResponseEmojis'

const twoColumnResponseMediaQuery = `@media screen and (min-width: ${ResponsesGridBreakpoints.TWO_RESPONSE_COLUMN}px)`
const threeColumnResponseMediaQuery = `@media screen and (min-width: ${ResponsesGridBreakpoints.THREE_RESPONSE_COLUMNS}px)`
const fourColumnResponseMediaQuery = `@media screen and (min-width: ${ResponsesGridBreakpoints.FOUR_RESPONSE_COLUMNS}px)`
const fiveColumnResponseMediaQuery = `@media screen and (min-width: ${ResponsesGridBreakpoints.FIVE_RESPONSE_COLUMNS}px)`

const ResponseWrapper = styled('div')<{
status: TransitionStatus
isSingleColumn: boolean
}>(({status, isSingleColumn}) => ({
}>(({status}) => ({
opacity: status === TransitionStatus.MOUNTED || status === TransitionStatus.EXITING ? 0 : 1,
transition: `box-shadow 100ms ${BezierCurve.DECELERATE}, opacity 300ms ${BezierCurve.DECELERATE}`,
display: 'flex',
flexDirection: 'column',
width: '100%',
maxWidth: isSingleColumn ? '600px' : undefined,
margin: isSingleColumn ? '0 auto' : undefined,
[twoColumnResponseMediaQuery]: {
width: isSingleColumn ? undefined : `calc(100% / 2 - ${ResponseCardDimensions.GAP}px)`
},
[threeColumnResponseMediaQuery]: {
width: isSingleColumn ? undefined : `calc(100% / 3 - ${ResponseCardDimensions.GAP}px)`
},
[fourColumnResponseMediaQuery]: {
width: isSingleColumn ? undefined : `calc(100% / 4 - ${ResponseCardDimensions.GAP}px)`
},
[fiveColumnResponseMediaQuery]: {
width: isSingleColumn ? undefined : `calc(100% / 5 - ${ResponseCardDimensions.GAP}px)`
}
maxWidth: '600px',
margin: '0 auto'
}))

const ResponseHeader = styled('div')({
Expand Down Expand Up @@ -115,12 +97,11 @@ interface Props {
stageRef: TeamPromptResponseCard_stage$key
status: TransitionStatus
displayIdx: number
isSingleColumn: boolean
onTransitionEnd: () => void
}

const TeamPromptResponseCard = (props: Props) => {
const {stageRef, status, onTransitionEnd, displayIdx, isSingleColumn} = props
const {stageRef, status, onTransitionEnd, displayIdx} = props
const responseStage = useFragment(
graphql`
fragment TeamPromptResponseCard_stage on TeamPromptResponseStage {
Expand Down Expand Up @@ -247,12 +228,7 @@ const TeamPromptResponseCard = (props: Props) => {
}

return (
<ResponseWrapper
ref={ref}
status={status}
onTransitionEnd={onTransitionEnd}
isSingleColumn={isSingleColumn}
>
<ResponseWrapper ref={ref} status={status} onTransitionEnd={onTransitionEnd}>
<ResponseHeader>
<Avatar picture={picture} className='h-12 w-12' />
<TeamMemberName>
Expand Down
16 changes: 5 additions & 11 deletions packages/client/components/TeamPromptMeeting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@ const ResponsesGridContainer = styled('div')({
padding: `32px ${GRID_PADDING_LEFT_RIGHT_PERCENT * 100}%`
}
})

const ResponsesGrid = styled('div')<{isSingleColumn: boolean}>(({isSingleColumn}) => ({
const ResponsesGrid = styled('div')({
flex: 1,
display: 'flex',
flexWrap: 'wrap',
flexDirection: isSingleColumn ? 'column' : 'row',
flexDirection: 'column',
position: 'relative',
gap: 32
}))
})

interface Props {
meeting: TeamPromptMeeting_meeting$key
Expand Down Expand Up @@ -88,15 +87,11 @@ const TeamPromptMeeting = (props: Props) => {
}
}
}
organization {
hasSingleColumnStandupsFlag: featureFlag(featureName: "singleColumnStandups")
}
}
`,
meetingRef
)
const {phases, organization} = meeting
const {hasSingleColumnStandupsFlag} = organization
const {phases} = meeting
const atmosphere = useAtmosphere()
const {viewerId} = atmosphere

Expand Down Expand Up @@ -180,7 +175,7 @@ const TeamPromptMeeting = (props: Props) => {
<TeamPromptEditablePrompt meetingRef={meeting} />
<ErrorBoundary>
<ResponsesGridContainer>
<ResponsesGrid isSingleColumn={hasSingleColumnStandupsFlag}>
<ResponsesGrid>
{transitioningStages.map((transitioningStage) => {
const {child: stage, onTransitionEnd, status} = transitioningStage
const {key, displayIdx} = stage
Expand All @@ -192,7 +187,6 @@ const TeamPromptMeeting = (props: Props) => {
onTransitionEnd={onTransitionEnd}
displayIdx={displayIdx}
stageRef={stage}
isSingleColumn={hasSingleColumnStandupsFlag}
/>
)
})}
Expand Down
Loading