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

fix: User can change team in Activity Library #9893

Merged
merged 1 commit into from
Jun 27, 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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const NewMeetingActionsCurrentMeetings = (props: Props) => {
</CurrentButton>
}
>
<MenuContent className='w-[300px]' sideOffset={10}>
<MenuContent className='w-[var(--radix-dropdown-menu-trigger-width)]'>
<SelectMeetingDropdown meetings={activeMeetings!} />
</MenuContent>
</Menu>
Expand Down
93 changes: 48 additions & 45 deletions packages/client/components/NewMeetingTeamPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {NewMeetingTeamPicker_teams$key} from '~/__generated__/NewMeetingTeamPick
import useAtmosphere from '../hooks/useAtmosphere'
import {PALETTE} from '../styles/paletteV3'
import {Menu} from '../ui/Menu/Menu'
import {MenuContent} from '../ui/Menu/MenuContent'
import setPreferredTeamId from '../utils/relay/setPreferredTeamId'
import NewMeetingTeamPickerAvatars from './NewMeetingTeamPickerAvatars'

Expand Down Expand Up @@ -72,52 +73,54 @@ const NewMeetingTeamPicker = (props: Props) => {
</div>
}
>
<div className='w-[var(--radix-dropdown-menu-trigger-width)]'>
{onShareToOrg ? (
<div className='w-[352px] p-4'>
<div>
This custom activity is private to the <b>{selectedTeam.name}</b> team.
<MenuContent>
<div className='w-[var(--radix-dropdown-menu-trigger-width)]'>
{onShareToOrg ? (
<div className='w-[352px] p-4'>
<div>
This custom activity is private to the <b>{selectedTeam.name}</b> team.
</div>
<br />
<div>
As a member of the team you can share this activity with other teams at the{' '}
<b>{selectedTeam.organization.name}</b> organization so that they can also use the
activity.
</div>
<button
onClick={onShareToOrg}
className={
'mt-4 flex w-max cursor-pointer items-center rounded-full border border-solid border-slate-400 bg-white px-3 py-2 text-center font-sans text-sm font-semibold text-slate-700 hover:bg-slate-100'
}
>
<LockOpen style={{marginRight: '8px', color: PALETTE.SLATE_600}} />
Allow other teams to use this activity
</button>
</div>
<br />
<div>
As a member of the team you can share this activity with other teams at the{' '}
<b>{selectedTeam.organization.name}</b> organization so that they can also use the
activity.
</div>
<button
onClick={onShareToOrg}
className={
'mt-4 flex w-max cursor-pointer items-center rounded-full border border-solid border-slate-400 bg-white px-3 py-2 text-center font-sans text-sm font-semibold text-slate-700 hover:bg-slate-100'
}
>
<LockOpen style={{marginRight: '8px', color: PALETTE.SLATE_600}} />
Allow other teams to use this activity
</button>
</div>
) : (
<>
<DropdownMenu.Label className='px-3 py-2 text-base font-semibold'>
Select Team:
</DropdownMenu.Label>
<DropdownMenu.Separator className='border-b border-slate-300' />
<div className='py-2'>
{teams.map((team) => {
return (
<DropdownMenu.Item
key={team.id}
className='px-3 py-1 text-base outline-none hover:bg-slate-200'
onClick={() => {
handleSelectTeam(team.id)
}}
>
{team.name}
</DropdownMenu.Item>
)
})}
</div>
</>
)}
</div>
) : (
<>
<DropdownMenu.Label className='px-3 py-2 text-base font-semibold'>
Select Team:
</DropdownMenu.Label>
<DropdownMenu.Separator className='border-b border-slate-300' />
<div className='py-2'>
{teams.map((team) => {
return (
<DropdownMenu.Item
key={team.id}
className='px-3 py-1 text-base outline-none hover:bg-slate-200'
onClick={() => {
handleSelectTeam(team.id)
}}
>
{team.name}
</DropdownMenu.Item>
)
})}
</div>
</>
)}
</div>
</MenuContent>
</Menu>
)
}
Expand Down
Loading