Skip to content

Commit 9567c4a

Browse files
committed
feat: minor changes
1 parent 3aa86d1 commit 9567c4a

File tree

4 files changed

+81
-25
lines changed

4 files changed

+81
-25
lines changed

apps/frontend/src/components/launches/add.edit.model.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -469,13 +469,16 @@ export const AddEditModal: FC<{
469469
</TopTitle>
470470

471471
{!existingData.integration && integrations.length > 1 ? (
472-
<PickPlatforms
473-
integrations={integrations.filter((f) => !f.disabled)}
474-
selectedIntegrations={[]}
475-
singleSelect={false}
476-
onChange={setSelectedIntegrations}
477-
isMain={true}
478-
/>
472+
<div className="w-full max-w-[600px] overflow-y-auto pb-[10px]">
473+
<PickPlatforms
474+
toolTip={true}
475+
integrations={integrations.filter((f) => !f.disabled)}
476+
selectedIntegrations={[]}
477+
singleSelect={false}
478+
onChange={setSelectedIntegrations}
479+
isMain={true}
480+
/>
481+
</div>
479482
) : (
480483
<div
481484
className={clsx(

apps/frontend/src/components/launches/generator/generator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export const GeneratorComponent = () => {
297297

298298
return (
299299
<button
300-
className="text-textColor p-[8px] rounded-md bg-red-700 flex justify-center items-center gap-[5px] outline-none"
300+
className="p-[8px] rounded-md bg-red-700 flex justify-center items-center gap-[5px] outline-none text-white"
301301
onClick={generate}
302302
>
303303
<svg

apps/frontend/src/components/launches/helpers/pick.platform.component.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const PickPlatforms: FC<{
1616
singleSelect: boolean;
1717
hide?: boolean;
1818
isMain: boolean;
19+
toolTip?: boolean;
1920
}> = (props) => {
2021
const { hide, isMain, integrations, selectedIntegrations, onChange } = props;
2122
const ref = useRef<HTMLDivElement>(null);
@@ -65,7 +66,7 @@ export const PickPlatforms: FC<{
6566
useMoveToIntegrationListener(
6667
[integrations],
6768
props.singleSelect,
68-
({identifier, toPreview}: {identifier: string, toPreview: boolean}) => {
69+
({ identifier, toPreview }: { identifier: string; toPreview: boolean }) => {
6970
const findIntegration = integrations.find((p) => p.id === identifier);
7071

7172
if (findIntegration) {
@@ -162,11 +163,11 @@ export const PickPlatforms: FC<{
162163
.filter((p) => p);
163164

164165
setSelectedAccounts(newIntegrations, () => {
165-
console.log('changed')
166+
console.log('changed');
166167
});
167168

168169
onChange(newIntegrations, () => {
169-
console.log('changed')
170+
console.log('changed');
170171
});
171172
};
172173

@@ -253,6 +254,10 @@ export const PickPlatforms: FC<{
253254
<div
254255
key={integration.id}
255256
className="flex gap-[8px] items-center mr-[10px]"
257+
{...(props.toolTip && {
258+
'data-tooltip-id': 'tooltip',
259+
'data-tooltip-content': integration.name,
260+
})}
256261
>
257262
<div
258263
onClick={addPlatform(integration)}

apps/frontend/src/components/launches/launches.component.tsx

Lines changed: 62 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,30 @@ interface MenuComponentInterface {
3333
update: (shouldReload: boolean) => void;
3434
}
3535

36+
export const OpenClose: FC<{
37+
isOpen: boolean;
38+
}> = (props) => {
39+
const { isOpen } = props;
40+
return (
41+
<svg
42+
width="11"
43+
height="6"
44+
viewBox="0 0 22 12"
45+
fill="none"
46+
xmlns="http://www.w3.org/2000/svg"
47+
className={clsx(
48+
'rotate-180 transition-all',
49+
isOpen ? 'rotate-180' : 'rotate-90'
50+
)}
51+
>
52+
<path
53+
d="M21.9245 11.3823C21.8489 11.5651 21.7207 11.7213 21.5563 11.8312C21.3919 11.9411 21.1986 11.9998 21.0008 11.9998H1.00079C0.802892 12 0.609399 11.9414 0.444805 11.8315C0.280212 11.7217 0.151917 11.5654 0.076165 11.3826C0.000412494 11.1998 -0.0193921 10.9986 0.0192583 10.8045C0.0579087 10.6104 0.153276 10.4322 0.293288 10.2923L10.2933 0.29231C10.3862 0.199333 10.4964 0.125575 10.6178 0.0752506C10.7392 0.0249263 10.8694 -0.000976562 11.0008 -0.000976562C11.1322 -0.000976562 11.2623 0.0249263 11.3837 0.0752506C11.5051 0.125575 11.6154 0.199333 11.7083 0.29231L21.7083 10.2923C21.8481 10.4322 21.9433 10.6105 21.9818 10.8045C22.0202 10.9985 22.0003 11.1996 21.9245 11.3823Z"
54+
fill="currentColor"
55+
/>
56+
</svg>
57+
);
58+
};
59+
3660
export const MenuGroupComponent: FC<
3761
MenuComponentInterface & {
3862
changeItemGroup: (id: string, group: string) => void;
@@ -59,6 +83,19 @@ export const MenuGroupComponent: FC<
5983
changeItemGroup,
6084
} = props;
6185

86+
const [isOpen, setIsOpen] = useState(
87+
!!+(localStorage.getItem(group.name + '_isOpen') || '1')
88+
);
89+
90+
const changeOpenClose = useCallback(
91+
(e: any) => {
92+
setIsOpen(!isOpen);
93+
localStorage.setItem(group.name + '_isOpen', isOpen ? '0' : '1');
94+
e.stopPropagation();
95+
},
96+
[isOpen]
97+
);
98+
6299
const [collectedProps, drop] = useDrop(() => ({
63100
accept: 'menu',
64101
drop: (item: { id: string }, monitor) => {
@@ -82,18 +119,27 @@ export const MenuGroupComponent: FC<
82119
</div>
83120
</div>
84121
)}
85-
{!!group.name && <div>{group.name}</div>}
86-
{group.values.map((integration) => (
87-
<MenuComponent
88-
key={integration.id}
89-
integration={integration}
90-
mutate={mutate}
91-
continueIntegration={continueIntegration}
92-
update={update}
93-
refreshChannel={refreshChannel}
94-
totalNonDisabledChannels={totalNonDisabledChannels}
95-
/>
96-
))}
122+
{!!group.name && (
123+
<div className="flex items-center gap-[5px] cursor-pointer" onClick={changeOpenClose}>
124+
<div>
125+
<OpenClose isOpen={isOpen} />
126+
</div>
127+
<div>{group.name}</div>
128+
</div>
129+
)}
130+
<div className={clsx("gap-[16px] flex flex-col relative", !isOpen && 'hidden')}>
131+
{group.values.map((integration) => (
132+
<MenuComponent
133+
key={integration.id}
134+
integration={integration}
135+
mutate={mutate}
136+
continueIntegration={continueIntegration}
137+
update={update}
138+
refreshChannel={refreshChannel}
139+
totalNonDisabledChannels={totalNonDisabledChannels}
140+
/>
141+
))}
142+
</div>
97143
</div>
98144
);
99145
};
@@ -220,7 +266,7 @@ export const MenuComponent: FC<
220266
export const LaunchesComponent = () => {
221267
const fetch = useFetch();
222268
const user = useUser();
223-
const {billingEnabled} = useVariables();
269+
const { billingEnabled } = useVariables();
224270
const router = useRouter();
225271
const search = useSearchParams();
226272
const toast = useToaster();
@@ -382,7 +428,9 @@ export const LaunchesComponent = () => {
382428
))}
383429
</div>
384430
<AddProviderButton update={() => update(true)} />
385-
{sortedIntegrations?.length > 0 && user?.tier?.ai && billingEnabled && <GeneratorComponent />}
431+
{sortedIntegrations?.length > 0 &&
432+
user?.tier?.ai &&
433+
billingEnabled && <GeneratorComponent />}
386434
</div>
387435
<div className="flex-1 flex flex-col gap-[14px]">
388436
<Filters />

0 commit comments

Comments
 (0)