Skip to content

Commit 9e54e31

Browse files
committed
fix: settings on the global edit
1 parent 98a6fb1 commit 9e54e31

File tree

2 files changed

+62
-15
lines changed

2 files changed

+62
-15
lines changed

apps/frontend/src/components/new-launch/manage.modal.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,19 @@ export const ManageModal: FC<AddEditModalProps> = (props) => {
105105

106106
const currentIntegrationText = useMemo(() => {
107107
if (current === 'global') {
108-
return '';
108+
return (
109+
<div className="flex items-center gap-[10px]">
110+
<div className="relative">
111+
<SettingsIcon
112+
size={15}
113+
className="text-white"
114+
/>
115+
</div>
116+
<div>
117+
Settings
118+
</div>
119+
</div>
120+
);
109121
}
110122

111123
const currentIntegration = integrations.find((p) => p.id === current)!;
@@ -425,8 +437,8 @@ export const ManageModal: FC<AddEditModalProps> = (props) => {
425437
<div
426438
id="social-empty"
427439
className={clsx(
428-
'pb-[16px]',
429-
current !== 'global' && 'hidden'
440+
'pb-[16px]'
441+
// current !== 'global' && 'hidden'
430442
)}
431443
/>
432444
</div>
@@ -436,11 +448,11 @@ export const ManageModal: FC<AddEditModalProps> = (props) => {
436448
id="wrapper-settings"
437449
className={clsx(
438450
'pb-[20px] px-[20px] select-none',
439-
current === 'global' && 'hidden',
440-
showSettings && 'flex-1 flex pt-[20px]'
451+
showSettings && 'flex-1 flex pt-[20px]',
452+
current === 'global' && 'hidden'
441453
)}
442454
>
443-
<div className="bg-newSettings flex-1 flex flex-col rounded-[12px] gap-[12px] overflow-hidden">
455+
<div className="flex-1 flex flex-col rounded-[12px] gap-[12px] overflow-hidden bg-newSettings">
444456
<div
445457
onClick={() => setShowSettings(!showSettings)}
446458
className={clsx(
@@ -465,9 +477,10 @@ export const ManageModal: FC<AddEditModalProps> = (props) => {
465477
)}
466478
>
467479
<div
468-
id="social-settings"
469-
className="px-[12px] pb-[12px] absolute left-0 top-0 w-full h-full overflow-x-hidden overflow-y-auto scrollbar scrollbar-thumb-newBgColorInner scrollbar-track-newColColor"
470-
/>
480+
className="absolute left-0 top-0 w-full h-full flex flex-col overflow-x-hidden overflow-y-auto scrollbar scrollbar-thumb-newBgColorInner scrollbar-track-newColColor"
481+
>
482+
<div id="social-settings" className="flex flex-col gap-[20px] bg-newBgColor" />
483+
</div>
471484
</div>
472485
<style>
473486
{`#social-settings [data-id="${current}"] {display: block !important;}`}

apps/frontend/src/components/new-launch/providers/high.order.provider.tsx

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import useSWR from 'swr';
2121
import { InternalChannels } from '@gitroom/frontend/components/launches/internal.channels';
2222
import { createPortal } from 'react-dom';
2323
import clsx from 'clsx';
24+
import Image from 'next/image';
2425

2526
class Empty {
2627
@IsOptional()
@@ -91,7 +92,7 @@ export const withProvider = function <T extends object>(params: {
9192
dummy,
9293
setChars,
9394
setComments,
94-
setHide
95+
setHide,
9596
} = useLaunchStore(
9697
useShallow((state) => ({
9798
date: state.date,
@@ -141,7 +142,9 @@ export const withProvider = function <T extends object>(params: {
141142
}
142143

143144
if (current) {
144-
setComments(typeof params.comments === 'undefined' ? true : params.comments);
145+
setComments(
146+
typeof params.comments === 'undefined' ? true : params.comments
147+
);
145148
setEditor(selectedIntegration?.integration.editor);
146149
setPostComment(postComment);
147150
setTotalChars(
@@ -258,7 +261,12 @@ export const withProvider = function <T extends object>(params: {
258261
}}
259262
>
260263
<FormProvider {...form}>
261-
<div className={clsx('border border-borderPreview rounded-[12px] shadow-previewShadow', !current && 'hidden')}>
264+
<div
265+
className={clsx(
266+
'border border-borderPreview rounded-[12px] shadow-previewShadow',
267+
!current && 'hidden'
268+
)}
269+
>
262270
{current &&
263271
(tab === 0 ||
264272
(!SettingsComponent && !data?.internalPlugs?.length)) &&
@@ -303,19 +311,45 @@ export const withProvider = function <T extends object>(params: {
303311
))}
304312
{(SettingsComponent || !!data?.internalPlugs?.length) &&
305313
createPortal(
306-
<div data-id={props.id} className="hidden">
314+
<div data-id={props.id} className={isGlobal ? 'bg-newSettings pb-[12px] px-[12px]' : 'hidden bg-newSettings px-[12px] pb-[12px]'}>
315+
{isGlobal && (
316+
<style>{`#wrapper-settings {display: flex !important} #social-empty {display: block !important;}`}</style>
317+
)}
318+
{isGlobal && (
319+
<div className="flex py-[20px] items-center gap-[15px]">
320+
<div className="relative">
321+
<Image
322+
alt={selectedIntegration?.integration.name!}
323+
width={42}
324+
height={42}
325+
className="min-w-[42px] min-h-[42px] w-[42px] h-[42px] rounded-full"
326+
src={selectedIntegration?.integration.picture}
327+
/>
328+
<Image
329+
alt={selectedIntegration?.integration.identifier}
330+
width={16}
331+
height={16}
332+
className="rounded-[16px] min-w-[16px] min-h-[16px] w-[16px] h-[16px] absolute bottom-0 end-0"
333+
src={`/icons/platforms/${selectedIntegration?.integration.identifier}.png`}
334+
/>
335+
</div>
336+
<div className="text-[20px]">{selectedIntegration?.integration.name}</div>
337+
</div>
338+
)}
307339
<SettingsComponent />
308340
{!!data?.internalPlugs?.length && !dummy && (
309341
<InternalChannels plugs={data?.internalPlugs} />
310342
)}
311343
</div>,
312-
document.querySelector('#social-settings') || document.createElement('div')
344+
document.querySelector('#social-settings') ||
345+
document.createElement('div')
313346
)}
314347
{current &&
315348
!SettingsComponent &&
316349
createPortal(
317350
<style>{`#wrapper-settings {display: none !important;} #social-empty {display: block !important;}`}</style>,
318-
document.querySelector('#social-settings') || document.createElement('div')
351+
document.querySelector('#social-settings') ||
352+
document.createElement('div')
319353
)}
320354
</div>
321355
</FormProvider>

0 commit comments

Comments
 (0)