forked from blankoslo/Pizza.v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pb-67: admin page mobile friendly (#108)
* fixes placements of postits in admin panel * tweaks event calendar for smalelr screens * fix: h-w issue events modal * final fix scaling events and calendar modal * fix tweaks rest of modals and adds slack channel modal for consistancy * tweaks font size * feat: makes create event better for mobile * chore: removesunused classnames * feat: delete event better for mobile
- Loading branch information
Showing
10 changed files
with
97 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 13 additions & 11 deletions
24
application/next-frontend/src/Admin/scenarios/AdminMainPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
application/next-frontend/src/Admin/scenarios/SlackChannel/components/SlackChannelModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { CardComponentWrapper } from '@/Admin/components/CardComponentWrapper' | ||
import { HoverProvider } from '@/Shared/context/HoverContext' | ||
import { useCurrentChannel } from '@/api/useCurrentChannel' | ||
import { SlackUser } from '@/api/useSlackUsers' | ||
|
||
const numUsersInChannel = (users: SlackUser[]) => { | ||
if (users.length === 0) return 'No users in channel' | ||
if (users.length === 1) return '1 user in channel' | ||
return `${users.length} users in channel` | ||
} | ||
|
||
const SlackChannelModal = () => { | ||
const { data, isLoading, error } = useCurrentChannel() | ||
|
||
const channelName = data?.channel_name | ||
const channelMembers = data?.users.filter((user) => user.active) ?? [] | ||
|
||
return ( | ||
<HoverProvider isInsideModal> | ||
<CardComponentWrapper title="Slack Channel" className="max-w-xl"> | ||
{isLoading ? ( | ||
'Loading...' | ||
) : error ? ( | ||
`Failed to load channel info due to the following error: ${error?.info.msg}` | ||
) : !data || !data.channel_id ? ( | ||
<div className="mt-5 break-keep font-workSans"> | ||
No slack channel has been set for the PizzaBot. Please use the command{' '} | ||
<b>/set‑pizza‑channel</b> in your preferred slack-channel to set. | ||
</div> | ||
) : ( | ||
<div className="mt-5 flex flex-col gap-4 pl-3 font-workSans"> | ||
<div className="text-2xl font-semibold"> | ||
<span>#{channelName}</span> | ||
</div> | ||
<div className="text-xl">{numUsersInChannel(channelMembers)}</div> | ||
<div className="my-8 break-keep text-xl"> | ||
If you want to change the channel I work in, use the command{' '} | ||
<b>/set‑pizza‑channel</b> in your preferred slack-channel to set. | ||
</div> | ||
</div> | ||
)} | ||
</CardComponentWrapper> | ||
</HoverProvider> | ||
) | ||
} | ||
|
||
export { SlackChannelModal } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters