Skip to content

📨 The ultimate agentic social media scheduling tool 🤖

fix: responsive

Nevo Davide756fa5743b0
diff --git a/apps/frontend/src/app/global.scss b/apps/frontend/src/app/global.scss
index a3dcef39e..75fc912b9 100644
--- a/apps/frontend/src/app/global.scss
+++ b/apps/frontend/src/app/global.scss
@@ -526,7 +526,10 @@ div div .set-font-family {
.hideChatbase #chatbase-bubble-button,
.hideChatbase #chatbase-bubble-window,
-.hideChatbase #chatbase-message-bubbles {
+.hideChatbase #chatbase-message-bubbles,
+.bottomSheetOpen #chatbase-bubble-button,
+.bottomSheetOpen #chatbase-bubble-window,
+.bottomSheetOpen #chatbase-message-bubbles {
display: none !important;
}
diff --git a/apps/frontend/src/components/launches/calendar.tsx b/apps/frontend/src/components/launches/calendar.tsx
index 8d18d57bb..205e324f7 100644
--- a/apps/frontend/src/components/launches/calendar.tsx
+++ b/apps/frontend/src/components/launches/calendar.tsx
@@ -59,6 +59,7 @@ import copy from 'copy-to-clipboard';
import { stripHtmlValidation } from '@gitroom/helpers/utils/strip.html.validation';
import { newDayjs } from '@gitroom/frontend/components/layout/set.timezone';
import { Button } from '@gitroom/react/form/button';
+import { ChevronUpIcon } from '@gitroom/frontend/components/ui/icons';
// Extend dayjs with necessary plugins
extend(isSameOrAfter);
@@ -489,7 +490,10 @@ export const MonthView = () => {
const days = [];
// Starting from Monday (1) to Sunday (7)
for (let i = 1; i <= 7; i++) {
- days.push(newDayjs().day(i).format('dddd'));
+ days.push({
+ name: newDayjs().day(i).format('dddd'),
+ short: newDayjs().day(i).format('ddd'),
+ });
}
return days;
}, [i18next.resolvedLanguage]);
@@ -529,19 +533,21 @@ export const MonthView = () => {
return (
<div className="flex flex-col text-textColor flex-1">
<div className="flex-1 flex relative">
- <div className="grid grid-cols-7 tablet:[grid-template-columns:repeat(7,_minmax(100px,_1fr))] grid-rows-[62px_auto] gap-[4px] rounded-[10px] absolute start-0 top-0 overflow-auto w-full h-full scrollbar scrollbar-thumb-tableBorder scrollbar-track-secondary">
+ {/* on phones the whole month fits the width, posts show as channel avatars */}
+ <div className="grid grid-cols-7 tablet:[grid-template-columns:repeat(7,_minmax(100px,_1fr))] mobile:!grid-cols-7 grid-rows-[62px_auto] mobile:grid-rows-[36px_auto] gap-[4px] mobile:gap-[2px] rounded-[10px] absolute start-0 top-0 overflow-auto w-full h-full scrollbar scrollbar-thumb-tableBorder scrollbar-track-secondary">
{localizedDays.map((day) => (
<div
- key={day}
- className="z-[20] p-2 bg-newTableHeader flex justify-center items-center flex-col h-[62px] rounded-[8px] sticky top-0"
+ key={day.name}
+ className="z-[20] p-2 mobile:p-0 bg-newTableHeader flex justify-center items-center flex-col h-[62px] mobile:h-[36px] rounded-[8px] sticky top-0"
>
- <div>{day}</div>
+ <div className="mobile:hidden">{day.name}</div>
+ <div className="hidden mobile:block text-[13px]">{day.short}</div>
</div>
))}
{calendarDays.map((date, index) => (
<div
key={index}
- className="text-center items-center justify-center flex"
+ className="text-center items-center justify-center flex mobile:min-w-0"
>
<CalendarColumn
getDate={newDayjs(date.day).endOf('day')}
@@ -916,11 +922,18 @@ export const CalendarColumn: FC<{
ref={drop as any}
>
{display === 'month' && (
- <div className={clsx('pt-[6px] text-[14px]')}>{getDate.date()}</div>
+ <div
+ className={clsx(
+ 'pt-[6px] text-[14px] mobile:pt-[4px] mobile:text-[12px]'
+ )}
+ >
+ {getDate.date()}
+ </div>
)}
<div
className={clsx(
'relative flex flex-col flex-1 text-white rounded-[8px] min-h-[70px]',
+ display === 'month' && 'mobile:min-h-[44px]',
canDrop && 'border border-[#612BD3]'
)}
>
@@ -928,7 +941,9 @@ export const CalendarColumn: FC<{
className={clsx(
'flex-col text-[12px] pointer w-full flex scrollbar scrollbar-thumb-tableBorder scrollbar-track-secondary',
isBeforeNow ? 'flex-1' : 'cursor-pointer',
- isBeforeNow && postList.length === 0 && 'col-calendar'
+ isBeforeNow && postList.length === 0 && 'col-calendar',
+ // the "Date passed" hint is wider than a phone month cell
+ display === 'month' && 'mobile:before:hidden'
)}
>
{loading && (
@@ -943,7 +958,12 @@ export const CalendarColumn: FC<{
'text-textColor p-[2.5px] relative flex flex-col justify-center items-center'
)}
>
- <div className="relative w-full flex flex-col items-center p-[2.5px]">
+ <div
+ className={clsx(
+ 'relative w-full flex flex-col items-center p-[2.5px]',
+ display === 'month' && 'mobile:p-0'
+ )}
+ >
<CalendarItem
display={display as 'day' | 'week' | 'month'}
isBeforeNow={isBeforeNow}
@@ -967,7 +987,14 @@ export const CalendarColumn: FC<{
className="text-center hover:underline py-[5px] text-textColor"
onClick={showAllFunc}
>
- {t('show_more', '+ Show more')} ({postList.length - 3})
+ <span className={clsx(display === 'month' && 'mobile:hidden')}>
+ {t('show_more', '+ Show more')} ({postList.length - 3})
+ </span>
+ {display === 'month' && (
+ <span className="hidden mobile:inline">
+ +{postList.length - 3}
+ </span>
+ )}
</div>
)}
{showAll && postList.length > 3 && (
@@ -975,7 +1002,12 @@ export const CalendarColumn: FC<{
className="text-center hover:underline py-[5px]"
onClick={showLessFunc}
>
- {t('show_less', '- Show less')}
+ <span className={clsx(display === 'month' && 'mobile:hidden')}>
+ {t('show_less', '- Show less')}
+ </span>
+ {display === 'month' && (
+ <ChevronUpIcon size={16} className="hidden mobile:inline" />
+ )}
</div>
)}
</div>
@@ -1131,7 +1163,10 @@ const CalendarItem: FC<{
>
{state === 'ERROR' && (
<div
- className="absolute -top-[6px] -start-[6px] z-20 w-[18px] h-[18px] rounded-full bg-red-500 flex items-center justify-center text-white text-[11px] font-bold cursor-pointer"
+ className={clsx(
+ 'absolute -top-[6px] -start-[6px] z-20 w-[18px] h-[18px] rounded-full bg-red-500 flex items-center justify-center text-white text-[11px] font-bold cursor-pointer',
+ display === 'month' && 'mobile:hidden'
+ )}
data-tooltip-id="tooltip"
data-tooltip-class-name="!max-w-[400px] break-words"
data-tooltip-content={post.error || 'An error occurred while publishing this post'}
@@ -1140,7 +1175,12 @@ const CalendarItem: FC<{
</div>
)}
{state === 'PUBLISHED' && (
- <div className="absolute -top-[6px] -start-[6px] z-20 w-[18px] h-[18px] rounded-full bg-green-500 flex items-center justify-center text-white text-[11px] font-bold">
+ <div
+ className={clsx(
+ 'absolute -top-[6px] -start-[6px] z-20 w-[18px] h-[18px] rounded-full bg-green-500 flex items-center justify-center text-white text-[11px] font-bold',
+ display === 'month' && 'mobile:hidden'
+ )}
+ >
✓
</div>
)}
@@ -1154,7 +1194,8 @@ const CalendarItem: FC<{
)}
<div
className={clsx(
- 'text-white text-[11px] max-h-[24px] h-[24px] min-h-[24px] w-full rounded-tr-[10px] rounded-tl-[10px] flex items-center justify-center gap-[6px] px-[5px] bg-btnPrimary'
+ 'text-white text-[11px] max-h-[24px] h-[24px] min-h-[24px] w-full rounded-tr-[10px] rounded-tl-[10px] flex items-center justify-center gap-[6px] px-[5px] bg-btnPrimary',
+ display === 'month' && 'mobile:hidden'
)}
style={{
backgroundColor: post?.tags?.[0]?.tag?.color,
@@ -1250,6 +1291,8 @@ const CalendarItem: FC<{
className={clsx(
'gap-[5px] w-full flex h-full flex-1 rounded-br-[10px] rounded-bl-[10px] p-[8px] text-[14px] bg-newColColor',
'relative',
+ display === 'month' &&
+ 'mobile:p-[4px] mobile:rounded-[10px] mobile:justify-center',
isBeforeNow && '!grayscale'
)}
>
@@ -1263,7 +1306,12 @@ const CalendarItem: FC<{
src={`/icons/platforms/${post.integration?.providerIdentifier}.png`}
/>
</div>
- <div className="w-full flex-1 flex flex-col min-h-[40px]">
+ <div
+ className={clsx(
+ 'w-full flex-1 flex flex-col min-h-[40px]',
+ display === 'month' && 'mobile:hidden'
+ )}
+ >
<div className="text-start">
{state === 'DRAFT' ? t('draft', 'Draft') + ': ' : ''}
</div>
diff --git a/apps/frontend/src/components/launches/filters.tsx b/apps/frontend/src/components/launches/filters.tsx
index 78e6102dd..e16729c63 100644
--- a/apps/frontend/src/components/launches/filters.tsx
+++ b/apps/frontend/src/components/launches/filters.tsx
@@ -3,12 +3,14 @@
import { useCalendar, ListStateFilter } from '@gitroom/frontend/components/launches/calendar.context';
import clsx from 'clsx';
import dayjs from 'dayjs';
-import { useCallback } from 'react';
+import { useCallback, useState } from 'react';
import { SelectCustomer } from '@gitroom/frontend/components/launches/select.customer';
import { SelectChannels } from '@gitroom/frontend/components/launches/select.channels';
import { useT } from '@gitroom/react/translation/get.transation.service.client';
import i18next from 'i18next';
import { newDayjs } from '@gitroom/frontend/components/layout/set.timezone';
+import { BottomSheet } from '@gitroom/frontend/components/ui/bottom.sheet.component';
+import { FilterIcon } from '@gitroom/frontend/components/ui/icons';
// Helper function to get start and end dates based on display type
function getDateRange(
@@ -44,19 +46,20 @@ function getDateRange(
export const Filters = () => {
const calendar = useCalendar();
const t = useT();
+ const [filtersOpen, setFiltersOpen] = useState(false);
// Set dayjs locale based on current language
const currentLanguage = i18next.resolvedLanguage || 'en';
dayjs.locale();
- // Calculate display date range text
- const getDisplayText = () => {
+ // Calculate display date range text, short is the phone version
+ const getDisplayText = (short?: boolean) => {
const startDate = newDayjs(calendar.startDate);
const endDate = newDayjs(calendar.endDate);
switch (calendar.display) {
case 'day':
- return startDate.format('dddd (L)');
+ return startDate.format(short ? 'ddd (L)' : 'dddd (L)');
case 'week':
return `${startDate.format('L')} - ${endDate.format('L')}`;
case 'month':
@@ -289,12 +292,13 @@ export const Filters = () => {
return (
<div className="text-textColor flex flex-row flex-wrap gap-[8px] items-center select-none">
+ {/* phones: view switcher and filter first, then the date or list row */}
{!isListView && (
- <div className="flex flex-grow flex-row items-center gap-[10px]">
- <div className="border h-[42px] border-newTableBorder bg-newTableBorder gap-[1px] flex items-center rounded-[8px] overflow-hidden">
+ <div className="flex flex-grow flex-row items-center gap-[10px] mobile:order-3 mobile:basis-full mobile:min-w-0 mobile:gap-[8px]">
+ <div className="border h-[42px] border-newTableBorder bg-newTableBorder gap-[1px] flex items-center rounded-[8px] overflow-hidden mobile:flex-1 mobile:min-w-0">
<div
onClick={previous}
- className="cursor-pointer text-textColor rtl:rotate-180 px-[9px] bg-newBgColorInner h-full flex items-center justify-center hover:text-textItemFocused hover:bg-boxFocused"
+ className="cursor-pointer text-textColor rtl:rotate-180 px-[9px] mobile:px-0 mobile:w-[36px] bg-newBgColorInner h-full flex items-center justify-center hover:text-textItemFocused hover:bg-boxFocused"
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -312,14 +316,17 @@ export const Filters = () => {
/>
</svg>
</div>
- <div className="min-w-[200px] mobile:min-w-[160px] text-center bg-newBgColorInner h-full flex items-center justify-center">
- <div className="py-[3px] px-[9px] rounded-[5px] transition-all text-[14px]">
- {getDisplayText()}
+ <div className="min-w-[200px] mobile:min-w-0 mobile:flex-1 text-center bg-newBgColorInner h-full flex items-center justify-center">
+ <div className="py-[3px] px-[9px] mobile:px-[4px] rounded-[5px] transition-all text-[14px] mobile:truncate">
+ <span className="mobile:hidden">{getDisplayText()}</span>
+ <span className="hidden mobile:inline">
+ {getDisplayText(true)}
+ </span>
</div>
</div>
<div
onClick={next}
- className="cursor-pointer text-textColor rtl:rotate-180 px-[9px] bg-newBgColorInner h-full flex items-center justify-center hover:text-textItemFocused hover:bg-boxFocused"
+ className="cursor-pointer text-textColor rtl:rotate-180 px-[9px] mobile:px-0 mobile:w-[36px] bg-newBgColorInner h-full flex items-center justify-center hover:text-textItemFocused hover:bg-boxFocused"
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -338,7 +345,7 @@ export const Filters = () => {
</svg>
</div>
</div>
- <div className="flex-1 text-[14px] font-[500]">
+ <div className="flex-1 mobile:flex-none text-[14px] font-[500]">
<div className="text-center flex h-[42px]">
<div
onClick={setToday}
@@ -351,12 +358,17 @@ export const Filters = () => {
</div>
)}
{isListView && (
- <div className="flex flex-grow flex-row items-center gap-[10px] mobile:flex-wrap">
- <div className="border h-[42px] border-newTableBorder bg-newTableBorder gap-[1px] flex items-center rounded-[8px] overflow-hidden">
+ <div className="flex flex-grow flex-row items-center gap-[10px] mobile:flex-wrap mobile:order-3 mobile:basis-full mobile:min-w-0 mobile:gap-[8px]">
+ <div
+ className={clsx(
+ 'border h-[42px] border-newTableBorder bg-newTableBorder gap-[1px] flex items-center rounded-[8px] overflow-hidden mobile:order-2 mobile:w-full',
+ calendar.listTotalPages <= 1 && 'mobile:hidden'
+ )}
+ >
<div
onClick={previousPage}
className={clsx(
- 'text-textColor rtl:rotate-180 px-[9px] bg-newBgColorInner h-full flex items-center justify-center',
+ 'text-textColor rtl:rotate-180 px-[9px] mobile:px-0 mobile:w-[36px] bg-newBgColorInner h-full flex items-center justify-center',
calendar.listPage > 0
? 'cursor-pointer hover:text-textItemFocused hover:bg-boxFocused'
: 'opacity-50 cursor-not-allowed'
@@ -378,7 +390,7 @@ export const Filters = () => {
/>
</svg>
</div>
- <div className="min-w-[200px] mobile:min-w-[160px] text-center bg-newBgColorInner h-full flex items-center justify-center">
+ <div className="min-w-[200px] mobile:min-w-0 mobile:flex-1 text-center bg-newBgColorInner h-full flex items-center justify-center">
<div className="py-[3px] px-[9px] rounded-[5px] transition-all text-[14px]">
{t('page', 'Page')} {calendar.listPage + 1} {t('of', 'of')} {Math.max(1, calendar.listTotalPages)}
</div>
@@ -386,7 +398,7 @@ export const Filters = () => {
<div
onClick={nextPage}
className={clsx(
- 'text-textColor rtl:rotate-180 px-[9px] bg-newBgColorInner h-full flex items-center justify-center',
+ 'text-textColor rtl:rotate-180 px-[9px] mobile:px-0 mobile:w-[36px] bg-newBgColorInner h-full flex items-center justify-center',
calendar.listPage < calendar.listTotalPages - 1
? 'cursor-pointer hover:text-textItemFocused hover:bg-boxFocused'
: 'opacity-50 cursor-not-allowed'
@@ -409,13 +421,13 @@ export const Filters = () => {
</svg>
</div>
</div>
- <div className="flex flex-row p-[4px] border border-newTableBorder rounded-[8px] text-[14px] font-[500] mobile:max-w-full mobile:overflow-x-auto">
+ <div className="flex flex-row p-[4px] border border-newTableBorder rounded-[8px] text-[14px] font-[500] mobile:order-1 mobile:w-full mobile:overflow-x-auto">
{listStateOptions.map((option) => (
<div
key={option.value}
onClick={setListStateFilter(option.value)}
className={clsx(
- 'pt-[6px] pb-[5px] cursor-pointer min-w-[80px] px-[12px] text-center rounded-[6px]',
+ 'pt-[6px] pb-[5px] cursor-pointer min-w-[80px] px-[12px] text-center rounded-[6px] mobile:flex-1 mobile:min-w-fit mobile:px-[8px] mobile:whitespace-nowrap',
calendar.listState === option.value &&
'text-textItemFocused bg-boxFocused'
)}
@@ -424,47 +436,79 @@ export const Filters = () => {
</div>
))}
</div>
- <div className="flex-1" />
+ <div className="flex-1 mobile:hidden" />
</div>
)}
- <SelectCustomer
- customer={calendar.customer as string}
- onChange={(customer: string) => setCustomer(customer)}
- integrations={calendar.integrations}
- />
- <SelectChannels />
- {!isListView && (
- <div className="flex flex-row p-[4px] border border-newTableBorder rounded-[8px] text-[14px] font-[500]">
- <div
- className={clsx(
- 'pt-[6px] pb-[5px] cursor-pointer w-[74px] mobile:w-[62px] text-center rounded-[6px]',
- calendar.display === 'day' && 'text-textItemFocused bg-boxFocused'
- )}
- onClick={setDay}
- >
- {t('day', 'Day')}
- </div>
- <div
- className={clsx(
- 'pt-[6px] pb-[5px] cursor-pointer w-[74px] mobile:w-[62px] text-center rounded-[6px]',
- calendar.display === 'week' && 'text-textItemFocused bg-boxFocused'
- )}
- onClick={setWeek}
- >
- {t('week', 'Week')}
- </div>
- <div
- className={clsx(
- 'pt-[6px] pb-[5px] cursor-pointer w-[74px] mobile:w-[62px] text-center rounded-[6px]',
- calendar.display === 'month' && 'text-textItemFocused bg-boxFocused'
- )}
- onClick={setMonth}
- >
- {t('month', 'Month')}
- </div>
+ {/* phones get a single filter button that opens the filters sheet */}
+ <div className="contents mobile:hidden">
+ <SelectCustomer
+ customer={calendar.customer as string}
+ onChange={(customer: string) => setCustomer(customer)}
+ integrations={calendar.integrations}
+ />
+ <SelectChannels />
+ </div>
+ {calendar.integrations.length > 1 && (
+ <div
+ onClick={() => setFiltersOpen(true)}
+ className={clsx(
+ 'hidden mobile:flex mobile:order-2 relative w-[42px] h-[42px] rounded-[8px] border justify-center items-center cursor-pointer',
+ calendar.selectedChannels
+ ? 'border-[#612BD3] text-[#612BD3]'
+ : 'border-newTableBorder'
+ )}
+ >
+ <FilterIcon />
+ {calendar.selectedChannels && (
+ <div className="absolute top-[6px] end-[6px] w-[6px] h-[6px] rounded-full bg-[#612BD3]" />
+ )}
</div>
)}
- <div className="flex flex-row p-[4px] border border-newTableBorder rounded-[8px] text-[14px] font-[500]">
+ <div
+ className={clsx(
+ 'flex flex-row p-[4px] border border-newTableBorder rounded-[8px] text-[14px] font-[500] mobile:order-1 mobile:flex-1 mobile:overflow-x-auto',
+ isListView && 'hidden mobile:flex'
+ )}
+ >
+ <div
+ className={clsx(
+ 'pt-[6px] pb-[5px] cursor-pointer w-[74px] mobile:w-auto mobile:flex-1 mobile:min-w-fit mobile:px-[6px] mobile:whitespace-nowrap text-center rounded-[6px]',
+ calendar.display === 'day' && 'text-textItemFocused bg-boxFocused'
+ )}
+ onClick={setDay}
+ >
+ {t('day', 'Day')}
+ </div>
+ <div
+ className={clsx(
+ 'pt-[6px] pb-[5px] cursor-pointer w-[74px] mobile:w-auto mobile:flex-1 mobile:min-w-fit mobile:px-[6px] mobile:whitespace-nowrap text-center rounded-[6px]',
+ calendar.display === 'week' && 'text-textItemFocused bg-boxFocused'
+ )}
+ onClick={setWeek}
+ >
+ {t('week', 'Week')}
+ </div>
+ <div
+ className={clsx(
+ 'pt-[6px] pb-[5px] cursor-pointer w-[74px] mobile:w-auto mobile:flex-1 mobile:min-w-fit mobile:px-[6px] mobile:whitespace-nowrap text-center rounded-[6px]',
+ calendar.display === 'month' && 'text-textItemFocused bg-boxFocused'
+ )}
+ onClick={setMonth}
+ >
+ {t('month', 'Month')}
+ </div>
+ {/* the list toggle joins the view switcher on phones */}
+ <div
+ className={clsx(
+ 'hidden mobile:block pt-[6px] pb-[5px] cursor-pointer mobile:flex-1 mobile:min-w-fit mobile:px-[6px] mobile:whitespace-nowrap text-center rounded-[6px]',
+ isListView && 'text-textItemFocused bg-boxFocused'
+ )}
+ onClick={setList}
+ >
+ {t('list', 'List')}
+ </div>
+ </div>
+ <div className="flex flex-row p-[4px] border border-newTableBorder rounded-[8px] text-[14px] font-[500] mobile:hidden">
<div
onClick={setCalendarView}
className={clsx(
@@ -514,6 +558,24 @@ export const Filters = () => {
</svg>
</div>
</div>
+ {filtersOpen && (
+ <BottomSheet
+ title={t('select_channels', 'Select Channels')}
+ onClose={() => setFiltersOpen(false)}
+ button={{
+ label: t('done', 'Done'),
+ onClick: () => setFiltersOpen(false),
+ }}
+ >
+ <SelectCustomer
+ list={true}
+ customer={calendar.customer as string}
+ onChange={(customer: string) => setCustomer(customer)}
+ integrations={calendar.integrations}
+ />
+ <SelectChannels list={true} />
+ </BottomSheet>
+ )}
</div>
);
};
diff --git a/apps/frontend/src/components/launches/select.channels.tsx b/apps/frontend/src/components/launches/select.channels.tsx
index b4c197806..3a5a73227 100644
--- a/apps/frontend/src/components/launches/select.channels.tsx
+++ b/apps/frontend/src/components/launches/select.channels.tsx
@@ -2,13 +2,18 @@
import React, { FC, useCallback, useMemo, useState } from 'react';
import clsx from 'clsx';
+import { uniqBy } from 'lodash';
import { useClickOutside } from '@mantine/hooks';
import { useCalendar } from '@gitroom/frontend/components/launches/calendar.context';
import { useT } from '@gitroom/react/translation/get.transation.service.client';
import { Checkbox } from '@gitroom/react/form/checkbox';
import { FilterIcon } from '@gitroom/frontend/components/ui/icons';
+import { Check } from '@gitroom/frontend/components/launches/tags.component';
+import { IntegrationListRow } from '@gitroom/frontend/components/new-launch/picks.socials.component';
-export const SelectChannels: FC = () => {
+export const SelectChannels: FC<{
+ list?: boolean;
+}> = ({ list }) => {
const { integrations, customer, selectedChannels, setSelectedChannels } =
useCalendar();
const t = useT();
@@ -58,6 +63,38 @@ export const SelectChannels: FC = () => {
return null;
}
+ if (list) {
+ // the customers are listed above the channels when there are any
+ const hasCustomers =
+ uniqBy(integrations, (i) => i?.customer?.id).length > 1;
+ return (
+ <div className="flex flex-col gap-[4px]">
+ {hasCustomers && (
+ <div className="text-[14px] font-[600] text-textItemBlur">
+ {t('channels', 'Channels')}
+ </div>
+ )}
+ <div
+ onClick={toggleAll}
+ className="flex items-center gap-[12px] py-[8px] cursor-pointer select-none"
+ >
+ <div className="flex-1 text-[14px] font-[600]">
+ {t('select_all', 'Select all')}
+ </div>
+ <Check onChange={() => {}} value={allSelected} />
+ </div>
+ {channels.map((p) => (
+ <IntegrationListRow
+ key={p.id}
+ integration={p}
+ selected={selectedIds.includes(p.id)}
+ onClick={toggle(p.id)}
+ />
+ ))}
+ </div>
+ );
+ }
+
return (
<div className="relative select-none z-[500]" ref={ref}>
<div
diff --git a/apps/frontend/src/components/launches/select.customer.tsx b/apps/frontend/src/components/launches/select.customer.tsx
index 2b42acc3f..617823d2e 100644
--- a/apps/frontend/src/components/launches/select.customer.tsx
+++ b/apps/frontend/src/components/launches/select.customer.tsx
@@ -15,8 +15,9 @@ export const SelectCustomer: FC<{
onChange: (value: string) => void;
integrations: Integrations[];
customer?: string;
+ list?: boolean;
}> = (props) => {
- const { onChange, integrations, customer: currentCustomer } = props;
+ const { onChange, integrations, customer: currentCustomer, list } = props;
const { setCurrent } = useLaunchStore(
useShallow((state) => ({
setCurrent: state.setCurrent,
@@ -47,10 +48,63 @@ export const SelectCustomer: FC<{
const totalCustomers = useMemo(() => {
return uniqBy(integrations, (i) => i?.customer?.id).length;
}, [integrations]);
+
+ const selectCustomer = useCallback(
+ (id: string) => () => {
+ toaster.show(
+ t('customer_socials_selected', 'Customer socials selected'),
+ 'success'
+ );
+ setCustomer(id);
+ onChange(id);
+ setOpen(false);
+ setCurrent('global');
+ },
+ [onChange]
+ );
+
if (totalCustomers <= 1) {
return null;
}
+ const customers = uniqBy(integrations, (u) => u?.customer?.name).filter(
+ (f) => f.customer?.name
+ );
+
+ if (list) {
+ return (
+ <div className="flex flex-col gap-[8px] pb-[16px]">
+ <div className="text-[14px] font-[600] text-textItemBlur">
+ {t('customers', 'Customers')}
+ </div>
+ {customers.map((p) => {
+ const selected = customer === p.customer?.id;
+ return (
+ <div
+ onClick={selectCustomer(p.customer?.id)}
+ key={p.customer?.id}
+ className="min-h-[48px] flex items-center justify-between gap-[12px] cursor-pointer select-none"
+ >
+ <div className="text-[14px] font-[600] truncate">
+ {p.customer?.name}
+ </div>
+ <div
+ className={clsx(
+ 'w-[24px] h-[24px] min-w-[24px] rounded-full border-[1.5px] flex justify-center items-center',
+ selected ? 'border-[#FC69FF]' : 'border-newTextColor/20'
+ )}
+ >
+ {selected && (
+ <div className="w-[12px] h-[12px] rounded-full bg-[#FC69FF]" />
+ )}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ );
+ }
+
return (
<div className="relative select-none z-[500]" ref={ref}>
<div
@@ -77,26 +131,15 @@ export const SelectCustomer: FC<{
<div className="text-[14px] font-[600] px-[12px] mb-[5px]">
{t('customers', 'Customers')}
</div>
- {uniqBy(integrations, (u) => u?.customer?.name)
- .filter((f) => f.customer?.name)
- .map((p) => (
- <div
- onClick={() => {
- toaster.show(
- t('customer_socials_selected', 'Customer socials selected'),
- 'success'
- );
- setCustomer(p.customer?.id);
- onChange(p.customer?.id);
- setOpen(false);
- setCurrent('global')
- }}
- key={p.customer?.id}
- className="p-[12px] hover:bg-newBgColor text-[14px] font-[500] h-[32px] flex items-center"
- >
- {p.customer?.name}
- </div>
- ))}
+ {customers.map((p) => (
+ <div
+ onClick={selectCustomer(p.customer?.id)}
+ key={p.customer?.id}
+ className="p-[12px] hover:bg-newBgColor text-[14px] font-[500] h-[32px] flex items-center"
+ >
+ {p.customer?.name}
+ </div>
+ ))}
</div>
)}
</div>
diff --git a/apps/frontend/src/components/new-launch/picks.socials.component.tsx b/apps/frontend/src/components/new-launch/picks.socials.component.tsx
index caae02537..6ffe4e5ff 100644
--- a/apps/frontend/src/components/new-launch/picks.socials.component.tsx
+++ b/apps/frontend/src/components/new-launch/picks.socials.component.tsx
@@ -28,6 +28,36 @@ const PlatformBadge: FC<{ integration: Integrations }> = ({ integration }) => {
);
};
+// a channel row with a checkbox, for the phone sheets
+export const IntegrationListRow: FC<{
+ integration: Integrations;
+ selected: boolean;
+ onClick: () => void;
+}> = ({ integration, selected, onClick }) => {
+ return (
+ <div
+ onClick={onClick}
+ className="flex items-center gap-[12px] py-[8px] cursor-pointer select-none"
+ >
+ <div className="relative">
+ <ImageWithFallback
+ fallbackSrc="/no-picture.jpg"
+ src={integration.picture || '/no-picture.jpg'}
+ className="rounded-[8px] min-w-[40px] min-h-[40px]"
+ alt={integration.identifier}
+ width={40}
+ height={40}
+ />
+ <PlatformBadge integration={integration} />
+ </div>
+ <div className="flex-1 min-w-0 truncate text-[14px] font-[600]">
+ {integration.name}
+ </div>
+ <Check onChange={() => {}} value={selected} />
+ </div>
+ );
+};
+
export const PicksSocialsComponent: FC<{
toolTip?: boolean;
list?: boolean;
@@ -73,35 +103,16 @@ export const PicksSocialsComponent: FC<{
locked && 'opacity-50 pointer-events-none'
)}
>
- {availableIntegrations.map((integration) => {
- const selected = selectedIntegrations.some(
- (p) => p.integration.id === integration.id
- );
-
- return (
- <div
- key={integration.id}
- onClick={toggleIntegration(integration)}
- className="flex items-center gap-[12px] py-[8px] cursor-pointer select-none"
- >
- <div className="relative">
- <ImageWithFallback
- fallbackSrc="/no-picture.jpg"
- src={integration.picture || '/no-picture.jpg'}
- className="rounded-[8px] min-w-[40px] min-h-[40px]"
- alt={integration.identifier}
- width={40}
- height={40}
- />
- <PlatformBadge integration={integration} />
- </div>
- <div className="flex-1 min-w-0 truncate text-[14px] font-[600]">
- {integration.name}
- </div>
- <Check onChange={() => {}} value={selected} />
- </div>
- );
- })}
+ {availableIntegrations.map((integration) => (
+ <IntegrationListRow
+ key={integration.id}
+ integration={integration}
+ selected={selectedIntegrations.some(
+ (p) => p.integration.id === integration.id
+ )}
+ onClick={toggleIntegration(integration)}
+ />
+ ))}
</div>
);
}
diff --git a/apps/frontend/src/components/ui/bottom.sheet.component.tsx b/apps/frontend/src/components/ui/bottom.sheet.component.tsx
index dec6911fe..dca5a6cdc 100644
--- a/apps/frontend/src/components/ui/bottom.sheet.component.tsx
+++ b/apps/frontend/src/components/ui/bottom.sheet.component.tsx
@@ -1,6 +1,6 @@
'use client';
-import React, { FC, ReactNode } from 'react';
+import React, { FC, ReactNode, useEffect } from 'react';
import {
ChevronRightIcon,
CloseIcon,
@@ -52,6 +52,14 @@ export const BottomSheet: FC<{
// the main action under the content, like Done or Save
button?: { label: string; onClick: () => void; disabled?: boolean };
}> = ({ title, onClose, children, button }) => {
+ // the support chat bubble would cover the sheet button
+ useEffect(() => {
+ document.querySelector('body')?.classList.add('bottomSheetOpen');
+ return () => {
+ document.querySelector('body')?.classList.remove('bottomSheetOpen');
+ };
+ }, []);
+
return (
<div className="fixed inset-0 z-[600] flex flex-col justify-end">
<div
diff --git a/i18n.lock b/i18n.lock
index aa0003366..6e2d38374 100644
--- a/i18n.lock
+++ b/i18n.lock
@@ -179,6 +179,7 @@ checksums:
day: 47648cd60fc313bc3f05b70357a1d675
week: 436fdd694160827dd6ea4644cdd0a8f8
month: ae7bef950efc406ff0980affabc1a64c
+ list: 94f13e7ef909a4de9db7abaa1f9f0b61
remove_from_customer: f572c0e84941d0d2d5ec1f3a15fdcb66
show_more: 1fe3f6f31d04d6dd29c0b1b27b991b52
show_less: 890358798c3b1a1a2f4b2bfff366405d
diff --git a/libraries/react-shared-libraries/src/translation/locales/ar/translation.json b/libraries/react-shared-libraries/src/translation/locales/ar/translation.json
index c3a231462..6b2bb647b 100644
--- a/libraries/react-shared-libraries/src/translation/locales/ar/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/ar/translation.json
@@ -175,6 +175,7 @@
"day": "يوم",
"week": "أسبوع",
"month": "شهر",
+ "list": "قائمة",
"remove_from_customer": "إزالة من العميل",
"show_more": "+ عرض المزيد",
"show_less": "- عرض أقل",
diff --git a/libraries/react-shared-libraries/src/translation/locales/bn/translation.json b/libraries/react-shared-libraries/src/translation/locales/bn/translation.json
index 0fd0db229..227c8d0ba 100644
--- a/libraries/react-shared-libraries/src/translation/locales/bn/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/bn/translation.json
@@ -175,6 +175,7 @@
"day": "দিন",
"week": "সপ্তাহ",
"month": "মাস",
+ "list": "তালিকা",
"remove_from_customer": "গ্রাহক থেকে সরান",
"show_more": "+ আরো দেখুন",
"show_less": "- কম দেখুন",
diff --git a/libraries/react-shared-libraries/src/translation/locales/de/translation.json b/libraries/react-shared-libraries/src/translation/locales/de/translation.json
index ba7c2ada7..ad516ffc7 100644
--- a/libraries/react-shared-libraries/src/translation/locales/de/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/de/translation.json
@@ -175,6 +175,7 @@
"day": "Tag",
"week": "Woche",
"month": "Monat",
+ "list": "Liste",
"remove_from_customer": "Vom Kunden entfernen",
"show_more": "+ Mehr anzeigen",
"show_less": "- Weniger anzeigen",
diff --git a/libraries/react-shared-libraries/src/translation/locales/en/translation.json b/libraries/react-shared-libraries/src/translation/locales/en/translation.json
index f67281438..ae1c81aef 100644
--- a/libraries/react-shared-libraries/src/translation/locales/en/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/en/translation.json
@@ -175,6 +175,7 @@
"day": "Day",
"week": "Week",
"month": "Month",
+ "list": "List",
"remove_from_customer": "Remove from customer",
"show_more": "+ Show more",
"show_less": "- Show less",
diff --git a/libraries/react-shared-libraries/src/translation/locales/es/translation.json b/libraries/react-shared-libraries/src/translation/locales/es/translation.json
index a1c10d0af..dca0314f7 100644
--- a/libraries/react-shared-libraries/src/translation/locales/es/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/es/translation.json
@@ -175,6 +175,7 @@
"day": "Día",
"week": "Semana",
"month": "Mes",
+ "list": "Lista",
"remove_from_customer": "Eliminar del cliente",
"show_more": "+ Mostrar más",
"show_less": "- Mostrar menos",
diff --git a/libraries/react-shared-libraries/src/translation/locales/fr/translation.json b/libraries/react-shared-libraries/src/translation/locales/fr/translation.json
index 2ff94b3e1..9bb4d07f3 100644
--- a/libraries/react-shared-libraries/src/translation/locales/fr/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/fr/translation.json
@@ -175,6 +175,7 @@
"day": "Jour",
"week": "Semaine",
"month": "Mois",
+ "list": "Liste",
"remove_from_customer": "Retirer du client",
"show_more": "+ Afficher plus",
"show_less": "- Afficher moins",
diff --git a/libraries/react-shared-libraries/src/translation/locales/he/translation.json b/libraries/react-shared-libraries/src/translation/locales/he/translation.json
index c0e6332c6..f597e6061 100644
--- a/libraries/react-shared-libraries/src/translation/locales/he/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/he/translation.json
@@ -175,6 +175,7 @@
"day": "יום",
"week": "שבוע",
"month": "חודש",
+ "list": "רשימה",
"remove_from_customer": "הסר מהלקוח",
"show_more": "+ הצג עוד",
"show_less": "- הצג פחות",
diff --git a/libraries/react-shared-libraries/src/translation/locales/it/translation.json b/libraries/react-shared-libraries/src/translation/locales/it/translation.json
index b105b053a..4a554c703 100644
--- a/libraries/react-shared-libraries/src/translation/locales/it/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/it/translation.json
@@ -175,6 +175,7 @@
"day": "Giorno",
"week": "Settimana",
"month": "Mese",
+ "list": "Elenco",
"remove_from_customer": "Rimuovi dal cliente",
"show_more": "+ Mostra di più",
"show_less": "- Mostra di meno",
diff --git a/libraries/react-shared-libraries/src/translation/locales/ja/translation.json b/libraries/react-shared-libraries/src/translation/locales/ja/translation.json
index c8e2c1a59..57f052d4b 100644
--- a/libraries/react-shared-libraries/src/translation/locales/ja/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/ja/translation.json
@@ -175,6 +175,7 @@
"day": "日",
"week": "週",
"month": "月",
+ "list": "リスト",
"remove_from_customer": "顧客から削除",
"show_more": "+もっと表示",
"show_less": "-表示を減らす",
diff --git a/libraries/react-shared-libraries/src/translation/locales/ko/translation.json b/libraries/react-shared-libraries/src/translation/locales/ko/translation.json
index af29a940e..17c5648f0 100644
--- a/libraries/react-shared-libraries/src/translation/locales/ko/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/ko/translation.json
@@ -175,6 +175,7 @@
"day": "일",
"week": "주",
"month": "월",
+ "list": "목록",
"remove_from_customer": "고객에서 제거",
"show_more": "+ 더 보기",
"show_less": "- 간략히 보기",
diff --git a/libraries/react-shared-libraries/src/translation/locales/pt/translation.json b/libraries/react-shared-libraries/src/translation/locales/pt/translation.json
index ca4ed8e0d..6e4c2367c 100644
--- a/libraries/react-shared-libraries/src/translation/locales/pt/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/pt/translation.json
@@ -175,6 +175,7 @@
"day": "Dia",
"week": "Semana",
"month": "Mês",
+ "list": "Lista",
"remove_from_customer": "Remover do cliente",
"show_more": "+ Mostrar mais",
"show_less": "- Mostrar menos",
diff --git a/libraries/react-shared-libraries/src/translation/locales/ru/translation.json b/libraries/react-shared-libraries/src/translation/locales/ru/translation.json
index de9cfd54c..580773094 100644
--- a/libraries/react-shared-libraries/src/translation/locales/ru/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/ru/translation.json
@@ -175,6 +175,7 @@
"day": "День",
"week": "Неделя",
"month": "Месяц",
+ "list": "Список",
"remove_from_customer": "Удалить от клиента",
"show_more": "+ Показать больше",
"show_less": "- Показать меньше",
diff --git a/libraries/react-shared-libraries/src/translation/locales/tr/translation.json b/libraries/react-shared-libraries/src/translation/locales/tr/translation.json
index f89f805f6..f94df9335 100644
--- a/libraries/react-shared-libraries/src/translation/locales/tr/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/tr/translation.json
@@ -175,6 +175,7 @@
"day": "Gün",
"week": "Hafta",
"month": "Ay",
+ "list": "Liste",
"remove_from_customer": "Müşteriden kaldır",
"show_more": "+ Daha fazla göster",
"show_less": "- Daha az göster",
diff --git a/libraries/react-shared-libraries/src/translation/locales/vi/translation.json b/libraries/react-shared-libraries/src/translation/locales/vi/translation.json
index 185309cad..65db01a72 100644
--- a/libraries/react-shared-libraries/src/translation/locales/vi/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/vi/translation.json
@@ -175,6 +175,7 @@
"day": "Ngày",
"week": "Tuần",
"month": "Tháng",
+ "list": "Danh sách",
"remove_from_customer": "Xóa khỏi khách hàng",
"show_more": "+ Xem thêm",
"show_less": "- Thu gọn",
diff --git a/libraries/react-shared-libraries/src/translation/locales/zh/translation.json b/libraries/react-shared-libraries/src/translation/locales/zh/translation.json
index e65d065ac..bc3261868 100644
--- a/libraries/react-shared-libraries/src/translation/locales/zh/translation.json
+++ b/libraries/react-shared-libraries/src/translation/locales/zh/translation.json
@@ -175,6 +175,7 @@
"day": "天",
"week": "周",
"month": "月",
+ "list": "列表",
"remove_from_customer": "从客户中移除",
"show_more": "+ 显示更多",
"show_less": "- 显示更少",