feat: thumb
This commit is contained in:
parent
0b2e266726
commit
382df926fa
|
|
@ -52,12 +52,12 @@ jobs:
|
|||
- name: Build and Push Image
|
||||
env:
|
||||
CONTAINERVER: ${{ needs.build-containers-common.outputs.containerver }}
|
||||
VERSION: ${{ github.ref_name }}
|
||||
NEXT_PUBLIC_VERSION: ${{ github.ref_name }}
|
||||
run: |
|
||||
docker buildx build --platform linux/${{ matrix.arch }} \
|
||||
-f Dockerfile.dev \
|
||||
-t ghcr.io/gitroomhq/postiz-app:${{ env.CONTAINERVER }}-${{ matrix.arch }} \
|
||||
--build-arg VERSION=${{ env.VERSION }} \
|
||||
--build-arg NEXT_PUBLIC_VERSION=${{ env.NEXT_PUBLIC_VERSION }} \
|
||||
--provenance=false --sbom=false \
|
||||
--output "type=registry,name=ghcr.io/gitroomhq/postiz-app:${{ env.CONTAINERVER }}-${{ matrix.arch }}" .
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
FROM node:20-alpine3.19
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
ARG NEXT_PUBLIC_VERSION
|
||||
ENV NEXT_PUBLIC_VERSION=$NEXT_PUBLIC_VERSION
|
||||
RUN apk add --no-cache g++ make py3-pip supervisor bash caddy
|
||||
RUN npm --no-update-notifier --no-fund --global install pnpm@10.6.1 pm2
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ ${type}
|
|||
}
|
||||
: {})}
|
||||
className={clsx(
|
||||
'relative ms-[10px] rounded-[4px] mb-[10px] gap-[8px] !text-primary justify-center items-center flex border border-dashed border-customColor21 bg-input',
|
||||
'relative ms-[10px] rounded-[4px] gap-[8px] !text-primary justify-center items-center flex border border-dashed border-customColor21 bg-input',
|
||||
value.length < 30 && 'opacity-25'
|
||||
)}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,114 @@
|
|||
'use client';
|
||||
|
||||
import { EventEmitter } from 'events';
|
||||
import React, { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { TopTitle } from '@gitroom/frontend/components/launches/helpers/top.title.component';
|
||||
const postUrlEmitter = new EventEmitter();
|
||||
|
||||
export const MediaSettingsLayout = () => {
|
||||
const [showPostSelector, setShowPostSelector] = useState(false);
|
||||
const [media, setMedia] = useState(undefined);
|
||||
const [callback, setCallback] = useState<{
|
||||
callback: (tag: string) => void;
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
} | null>({
|
||||
callback: (tag: string) => {},
|
||||
} as any);
|
||||
useEffect(() => {
|
||||
postUrlEmitter.on(
|
||||
'show',
|
||||
(params: { media: any; callback: (url: string) => void }) => {
|
||||
setCallback(params);
|
||||
setMedia(params.media);
|
||||
setShowPostSelector(true);
|
||||
}
|
||||
);
|
||||
return () => {
|
||||
setShowPostSelector(false);
|
||||
setCallback(null);
|
||||
setMedia(undefined);
|
||||
postUrlEmitter.removeAllListeners();
|
||||
};
|
||||
}, []);
|
||||
const close = useCallback(() => {
|
||||
setShowPostSelector(false);
|
||||
setCallback(null);
|
||||
setMedia(undefined);
|
||||
}, []);
|
||||
if (!showPostSelector) {
|
||||
return <></>;
|
||||
}
|
||||
return (
|
||||
<MediaComponentInner
|
||||
media={media}
|
||||
onClose={close}
|
||||
onSelect={callback?.callback!}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export const useMediaSettings = () => {
|
||||
return useCallback((media: any) => {
|
||||
return new Promise((resolve) => {
|
||||
postUrlEmitter.emit('show', {
|
||||
media,
|
||||
callback: (value: any) => {
|
||||
resolve(value);
|
||||
},
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
};
|
||||
|
||||
export const CreateThumbnail: FC<{
|
||||
media:
|
||||
| { id: string; name: string; path: string; thumbnail: string }
|
||||
| undefined;
|
||||
}> = (props) => {
|
||||
return null;
|
||||
};
|
||||
|
||||
export const MediaComponentInner: FC<{
|
||||
onClose: () => void;
|
||||
onSelect: (tag: string) => void;
|
||||
media:
|
||||
| { id: string; name: string; path: string; thumbnail: string }
|
||||
| undefined;
|
||||
}> = (props) => {
|
||||
const { onClose, onSelect, media } = props;
|
||||
|
||||
return (
|
||||
<div className="text-textColor fixed start-0 top-0 bg-primary/80 z-[300] w-full h-full p-[60px] animate-fade justify-center flex">
|
||||
<div className="flex flex-col w-[500px] h-[250px] bg-sixth border-tableBorder border-2 rounded-xl pb-[20px] px-[20px] relative">
|
||||
<div className="flex">
|
||||
<div className="flex-1">
|
||||
<TopTitle title={'Media Setting'} />
|
||||
</div>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="outline-none absolute end-[20px] top-[20px] mantine-UnstyledButton-root mantine-ActionIcon-root bg-primary hover:bg-tableBorder cursor-pointer mantine-Modal-close mantine-1dcetaa"
|
||||
type="button"
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 15 15"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
>
|
||||
<path
|
||||
d="M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z"
|
||||
fill="currentColor"
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div className="mt-[10px]">
|
||||
{media?.path.indexOf('mp4') > -1 && <CreateThumbnail media={media} />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
@ -453,7 +453,7 @@ export const LaunchesComponent = () => {
|
|||
user?.tier?.ai &&
|
||||
billingEnabled && <GeneratorComponent />}
|
||||
<div className="mt-[5px]">
|
||||
{process.env.VERSION ? `v${process.env.VERSION}` : ''}
|
||||
{process.env.NEXT_PUBLIC_VERSION ? `v${process.env.NEXT_PUBLIC_VERSION}` : ''}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ import { ChromeExtensionComponent } from '@gitroom/frontend/components/layout/ch
|
|||
import { LanguageComponent } from '@gitroom/frontend/components/layout/language.component';
|
||||
import { useT } from '@gitroom/react/translation/get.transation.service.client';
|
||||
import i18next from '@gitroom/react/translation/i18next';
|
||||
import { MediaSettingsLayout } from '@gitroom/frontend/components/launches/helpers/media.settings.component';
|
||||
extend(utc);
|
||||
extend(weekOfYear);
|
||||
extend(isoWeek);
|
||||
|
|
@ -79,6 +80,7 @@ export const LayoutSettings = ({ children }: { children: ReactNode }) => {
|
|||
<ToolTip />
|
||||
<ShowMediaBoxModal />
|
||||
<ShowLinkedinCompany />
|
||||
<MediaSettingsLayout />
|
||||
<Toaster />
|
||||
<ShowPostSelector />
|
||||
<NewSubscription />
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import {
|
||||
import React, {
|
||||
ClipboardEvent,
|
||||
FC,
|
||||
Fragment,
|
||||
|
|
@ -30,6 +30,7 @@ import { deleteDialog } from '@gitroom/react/helpers/delete.dialog';
|
|||
import { useT } from '@gitroom/react/translation/get.transation.service.client';
|
||||
import { ThirdPartyMedia } from '@gitroom/frontend/components/third-parties/third-party.media';
|
||||
import { ReactSortable } from 'react-sortablejs';
|
||||
import { useMediaSettings } from '@gitroom/frontend/components/launches/helpers/media.settings.component';
|
||||
const Polonto = dynamic(
|
||||
() => import('@gitroom/frontend/components/launches/polonto')
|
||||
);
|
||||
|
|
@ -550,46 +551,108 @@ export const MultiMediaComponent: FC<{
|
|||
setMediaModal(true);
|
||||
}, []);
|
||||
|
||||
const mediaSettings = useMediaSettings();
|
||||
|
||||
const t = useT();
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex flex-col gap-[8px] bg-input rounded-bl-[8px] select-none">
|
||||
<div className="flex flex-col gap-[8px] bg-input rounded-bl-[8px] select-none w-full">
|
||||
{modal && <MediaBox setMedia={changeMedia} closeModal={showModal} />}
|
||||
{mediaModal && !!user?.tier?.ai && (
|
||||
<Polonto setMedia={changeMedia} closeModal={closeDesignModal} />
|
||||
)}
|
||||
<div className="flex gap-[10px]">
|
||||
<div className="flex">
|
||||
<Button
|
||||
onClick={showModal}
|
||||
className="ms-[10px] rounded-[4px] mb-[10px] gap-[8px] !text-primary justify-center items-center w-[127px] flex border border-dashed border-customColor21 bg-input"
|
||||
>
|
||||
<div className="flex gap-[5px] items-center">
|
||||
<div>
|
||||
<svg
|
||||
className="!text-primary"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
d="M19.5 3H7.5C7.10218 3 6.72064 3.15804 6.43934 3.43934C6.15804 3.72064 6 4.10218 6 4.5V6H4.5C4.10218 6 3.72064 6.15804 3.43934 6.43934C3.15804 6.72064 3 7.10218 3 7.5V19.5C3 19.8978 3.15804 20.2794 3.43934 20.5607C3.72064 20.842 4.10218 21 4.5 21H16.5C16.8978 21 17.2794 20.842 17.5607 20.5607C17.842 20.2794 18 19.8978 18 19.5V18H19.5C19.8978 18 20.2794 17.842 20.5607 17.5607C20.842 17.2794 21 16.8978 21 16.5V4.5C21 4.10218 20.842 3.72064 20.5607 3.43934C20.2794 3.15804 19.8978 3 19.5 3ZM7.5 4.5H19.5V11.0044L17.9344 9.43875C17.6531 9.15766 17.2717 8.99976 16.8741 8.99976C16.4764 8.99976 16.095 9.15766 15.8137 9.43875L8.75344 16.5H7.5V4.5ZM16.5 19.5H4.5V7.5H6V16.5C6 16.8978 6.15804 17.2794 6.43934 17.5607C6.72064 17.842 7.10218 18 7.5 18H16.5V19.5ZM19.5 16.5H10.875L16.875 10.5L19.5 13.125V16.5ZM11.25 10.5C11.695 10.5 12.13 10.368 12.5 10.1208C12.87 9.87357 13.1584 9.52217 13.3287 9.11104C13.499 8.6999 13.5436 8.2475 13.4568 7.81105C13.37 7.37459 13.1557 6.97368 12.841 6.65901C12.5263 6.34434 12.1254 6.13005 11.689 6.04323C11.2525 5.95642 10.8001 6.00097 10.389 6.17127C9.97783 6.34157 9.62643 6.62996 9.37919 6.99997C9.13196 7.36998 9 7.80499 9 8.25C9 8.84674 9.23705 9.41903 9.65901 9.84099C10.081 10.2629 10.6533 10.5 11.25 10.5ZM11.25 7.5C11.3983 7.5 11.5433 7.54399 11.6667 7.6264C11.79 7.70881 11.8861 7.82594 11.9429 7.96299C11.9997 8.10003 12.0145 8.25083 11.9856 8.39632C11.9566 8.5418 11.8852 8.67544 11.7803 8.78033C11.6754 8.88522 11.5418 8.95665 11.3963 8.98559C11.2508 9.01453 11.1 8.99968 10.963 8.94291C10.8259 8.88614 10.7088 8.79001 10.6264 8.66668C10.544 8.54334 10.5 8.39834 10.5 8.25C10.5 8.05109 10.579 7.86032 10.7197 7.71967C10.8603 7.57902 11.0511 7.5 11.25 7.5Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="text-[12px] font-[500] !text-current">
|
||||
{t('insert_media', 'Insert Media')}
|
||||
</div>
|
||||
</div>
|
||||
</Button>
|
||||
|
||||
<div className="flex gap-[10px]">
|
||||
<Button
|
||||
onClick={showModal}
|
||||
className="ms-[10px] !px-[0] !h-[80px] w-[80px] rounded-[4px] mb-[10px] gap-[8px] !text-primary justify-center items-center flex border border-dashed border-customColor21 bg-input"
|
||||
>
|
||||
<div className="flex flex-col gap-[5px] items-center">
|
||||
<div>
|
||||
<svg
|
||||
className="!text-primary"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
d="M19.5 3H7.5C7.10218 3 6.72064 3.15804 6.43934 3.43934C6.15804 3.72064 6 4.10218 6 4.5V6H4.5C4.10218 6 3.72064 6.15804 3.43934 6.43934C3.15804 6.72064 3 7.10218 3 7.5V19.5C3 19.8978 3.15804 20.2794 3.43934 20.5607C3.72064 20.842 4.10218 21 4.5 21H16.5C16.8978 21 17.2794 20.842 17.5607 20.5607C17.842 20.2794 18 19.8978 18 19.5V18H19.5C19.8978 18 20.2794 17.842 20.5607 17.5607C20.842 17.2794 21 16.8978 21 16.5V4.5C21 4.10218 20.842 3.72064 20.5607 3.43934C20.2794 3.15804 19.8978 3 19.5 3ZM7.5 4.5H19.5V11.0044L17.9344 9.43875C17.6531 9.15766 17.2717 8.99976 16.8741 8.99976C16.4764 8.99976 16.095 9.15766 15.8137 9.43875L8.75344 16.5H7.5V4.5ZM16.5 19.5H4.5V7.5H6V16.5C6 16.8978 6.15804 17.2794 6.43934 17.5607C6.72064 17.842 7.10218 18 7.5 18H16.5V19.5ZM19.5 16.5H10.875L16.875 10.5L19.5 13.125V16.5ZM11.25 10.5C11.695 10.5 12.13 10.368 12.5 10.1208C12.87 9.87357 13.1584 9.52217 13.3287 9.11104C13.499 8.6999 13.5436 8.2475 13.4568 7.81105C13.37 7.37459 13.1557 6.97368 12.841 6.65901C12.5263 6.34434 12.1254 6.13005 11.689 6.04323C11.2525 5.95642 10.8001 6.00097 10.389 6.17127C9.97783 6.34157 9.62643 6.62996 9.37919 6.99997C9.13196 7.36998 9 7.80499 9 8.25C9 8.84674 9.23705 9.41903 9.65901 9.84099C10.081 10.2629 10.6533 10.5 11.25 10.5ZM11.25 7.5C11.3983 7.5 11.5433 7.54399 11.6667 7.6264C11.79 7.70881 11.8861 7.82594 11.9429 7.96299C11.9997 8.10003 12.0145 8.25083 11.9856 8.39632C11.9566 8.5418 11.8852 8.67544 11.7803 8.78033C11.6754 8.88522 11.5418 8.95665 11.3963 8.98559C11.2508 9.01453 11.1 8.99968 10.963 8.94291C10.8259 8.88614 10.7088 8.79001 10.6264 8.66668C10.544 8.54334 10.5 8.39834 10.5 8.25C10.5 8.05109 10.579 7.86032 10.7197 7.71967C10.8603 7.57902 11.0511 7.5 11.25 7.5Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="text-[12px] font-[500] !text-current">
|
||||
{t('insert_media', 'Insert Media')}
|
||||
</div>
|
||||
</div>
|
||||
</Button>
|
||||
|
||||
{!!currentMedia && (
|
||||
<ReactSortable
|
||||
list={currentMedia}
|
||||
setList={(value) =>
|
||||
onChange({ target: { name: 'upload', value } })
|
||||
}
|
||||
className="flex gap-[10px] sortable-container"
|
||||
animation={200}
|
||||
swap={true}
|
||||
handle=".dragging"
|
||||
>
|
||||
{currentMedia.map((media, index) => (
|
||||
<Fragment key={media.id}>
|
||||
<div className="cursor-pointer rounded-[4px] w-[80px] h-[80px] border-2 border-tableBorder relative flex transition-all">
|
||||
<div className="dragging text-sm absolute pe-[1px] z-[10] pb-[3px] -start-[4px] -top-[4px] bg-blue-700 cursor-move rounded-full w-[15px] h-[15px] text-white flex justify-center items-center">
|
||||
::
|
||||
</div>
|
||||
|
||||
<div className="w-full h-full relative group">
|
||||
<div
|
||||
onClick={() => mediaSettings(media)}
|
||||
className="absolute top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%] bg-black/80 rounded-[10px] opacity-0 group-hover:opacity-100 transition-opacity z-[100]"
|
||||
>
|
||||
<svg
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 40 40"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="cursor-pointer relative z-[200]"
|
||||
>
|
||||
<path
|
||||
d="M19.9987 15.5C19.1087 15.5 18.2387 15.7639 17.4986 16.2584C16.7586 16.7528 16.1818 17.4556 15.8413 18.2779C15.5007 19.1002 15.4115 20.005 15.5852 20.8779C15.7588 21.7508 16.1874 22.5526 16.8167 23.182C17.4461 23.8113 18.2479 24.2399 19.1208 24.4135C19.9937 24.5871 20.8985 24.498 21.7208 24.1574C22.5431 23.8168 23.2459 23.2401 23.7403 22.5C24.2348 21.76 24.4987 20.89 24.4987 20C24.4975 18.8069 24.023 17.663 23.1793 16.8194C22.3357 15.9757 21.1918 15.5012 19.9987 15.5ZM19.9987 23C19.4054 23 18.8254 22.824 18.332 22.4944C17.8387 22.1647 17.4541 21.6962 17.2271 21.148C17 20.5999 16.9406 19.9967 17.0564 19.4147C17.1721 18.8328 17.4578 18.2982 17.8774 17.8787C18.297 17.4591 18.8315 17.1734 19.4134 17.0576C19.9954 16.9419 20.5986 17.0013 21.1468 17.2283C21.6949 17.4554 22.1635 17.8399 22.4931 18.3333C22.8228 18.8266 22.9987 19.4066 22.9987 20C22.9987 20.7956 22.6826 21.5587 22.12 22.1213C21.5574 22.6839 20.7944 23 19.9987 23ZM30.3056 18.0509C30.2847 17.9453 30.2413 17.8454 30.1784 17.7581C30.1155 17.6707 30.0345 17.5979 29.9409 17.5447L27.1443 15.9509L27.1331 12.799C27.1327 12.6905 27.1089 12.5833 27.063 12.4849C27.0172 12.3865 26.9506 12.2992 26.8678 12.229C25.8533 11.3709 24.6851 10.7134 23.4253 10.2912C23.3261 10.2577 23.2209 10.2452 23.1166 10.2547C23.0123 10.2643 22.9111 10.2955 22.8197 10.3465L19.9987 11.9234L17.175 10.3437C17.0834 10.2924 16.9821 10.2609 16.8776 10.2513C16.7732 10.2416 16.6678 10.2539 16.5684 10.2875C15.3095 10.7127 14.1426 11.3728 13.1297 12.2328C13.0469 12.3028 12.9804 12.39 12.9346 12.4882C12.8888 12.5865 12.8648 12.6935 12.8643 12.8019L12.8503 15.9565L10.0537 17.5503C9.96015 17.6036 9.87916 17.6763 9.81623 17.7637C9.7533 17.8511 9.70992 17.9509 9.68903 18.0565C9.43309 19.3427 9.43309 20.6667 9.68903 21.9528C9.70992 22.0584 9.7533 22.1583 9.81623 22.2456C9.87916 22.333 9.96015 22.4058 10.0537 22.459L12.8503 24.0528L12.8615 27.2047C12.8619 27.3132 12.8858 27.4204 12.9316 27.5188C12.9774 27.6172 13.044 27.7045 13.1268 27.7747C14.1413 28.6328 15.3095 29.2904 16.5693 29.7125C16.6686 29.7461 16.7737 29.7585 16.878 29.749C16.9823 29.7394 17.0835 29.7082 17.175 29.6572L19.9987 28.0765L22.8225 29.6562C22.9342 29.7185 23.0602 29.7508 23.1881 29.75C23.27 29.75 23.3514 29.7367 23.429 29.7106C24.6878 29.286 25.8547 28.6265 26.8678 27.7672C26.9505 27.6971 27.017 27.61 27.0628 27.5117C27.1087 27.4135 27.1326 27.3065 27.1331 27.1981L27.1472 24.0434L29.9437 22.4497C30.0373 22.3964 30.1183 22.3236 30.1812 22.2363C30.2441 22.1489 30.2875 22.049 30.3084 21.9434C30.5629 20.6583 30.562 19.3357 30.3056 18.0509ZM28.8993 21.3237L26.2209 22.8472C26.1035 22.9139 26.0064 23.0111 25.9397 23.1284C25.8853 23.2222 25.8281 23.3215 25.77 23.4153C25.6956 23.5335 25.6559 23.6703 25.6556 23.81L25.6415 26.8334C24.9216 27.3988 24.1195 27.8509 23.2631 28.174L20.5612 26.6684C20.449 26.6064 20.3228 26.5741 20.1947 26.5747H20.1768C20.0634 26.5747 19.949 26.5747 19.8356 26.5747C19.7014 26.5713 19.5688 26.6037 19.4512 26.6684L16.7475 28.1778C15.8892 27.8571 15.0849 27.4072 14.3625 26.8437L14.3522 23.825C14.3517 23.685 14.3121 23.548 14.2378 23.4294C14.1797 23.3356 14.1225 23.2419 14.069 23.1425C14.0028 23.0233 13.9056 22.9242 13.7878 22.8556L11.1065 21.3284C10.9678 20.4507 10.9678 19.5567 11.1065 18.679L13.7803 17.1528C13.8976 17.0861 13.9948 16.9889 14.0615 16.8715C14.1159 16.7778 14.1731 16.6784 14.2312 16.5847C14.3056 16.4664 14.3453 16.3297 14.3456 16.19L14.3597 13.1665C15.0796 12.6012 15.8816 12.1491 16.7381 11.8259L19.4362 13.3315C19.5536 13.3966 19.6864 13.429 19.8206 13.4253C19.934 13.4253 20.0484 13.4253 20.1618 13.4253C20.296 13.4286 20.4287 13.3963 20.5462 13.3315L23.25 11.8222C24.1082 12.1429 24.9125 12.5927 25.635 13.1562L25.6453 16.175C25.6457 16.3149 25.6854 16.452 25.7597 16.5706C25.8178 16.6644 25.875 16.7581 25.9284 16.8575C25.9947 16.9767 26.0918 17.0758 26.2097 17.1444L28.8909 18.6715C29.0315 19.5499 29.0331 20.4449 28.8956 21.3237H28.8993Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
{media?.path?.indexOf('mp4') > -1 ? (
|
||||
<VideoFrame url={mediaDirectory.set(media?.path)} />
|
||||
) : (
|
||||
<img
|
||||
className="w-full h-full object-cover rounded-[4px]"
|
||||
src={mediaDirectory.set(media?.path)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
onClick={clearMedia(index)}
|
||||
className="rounded-full w-[15px] h-[15px] bg-red-800 text-white flex justify-center items-center absolute -end-[4px] -top-[4px]"
|
||||
>
|
||||
x
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
))}
|
||||
</ReactSortable>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex gap-[10px] bg-customColor55 w-full">
|
||||
<div className="flex py-[10px]">
|
||||
<Button
|
||||
onClick={designMedia}
|
||||
className="ms-[10px] rounded-[4px] mb-[10px] gap-[8px] !text-primary justify-center items-center w-[127px] flex border border-dashed border-customColor21 bg-input"
|
||||
className="ms-[10px] rounded-[4px] gap-[8px] !text-primary justify-center items-center w-[127px] flex border border-dashed border-customColor21 bg-input"
|
||||
>
|
||||
<div className="flex gap-[5px] items-center">
|
||||
<div>
|
||||
|
|
@ -618,51 +681,6 @@ export const MultiMediaComponent: FC<{
|
|||
<AiImage value={text} onChange={changeMedia} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
{!!currentMedia && (
|
||||
<ReactSortable
|
||||
list={currentMedia}
|
||||
setList={(value) =>
|
||||
onChange({ target: { name: 'upload', value } })
|
||||
}
|
||||
className="flex gap-[10px] sortable-container"
|
||||
animation={200}
|
||||
swap={true}
|
||||
handle=".dragging"
|
||||
>
|
||||
{currentMedia.map((media, index) => (
|
||||
<Fragment key={media.id}>
|
||||
<div className="cursor-pointer w-[40px] h-[40px] border-2 border-tableBorder relative flex transition-all">
|
||||
<div className="dragging text-sm absolute pe-[1px] z-[10] pb-[3px] -start-[4px] -top-[4px] bg-blue-700 cursor-move rounded-full w-[15px] h-[15px] text-white flex justify-center items-center">
|
||||
::
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="w-full h-full"
|
||||
onClick={() =>
|
||||
window.open(mediaDirectory.set(media?.path))
|
||||
}
|
||||
>
|
||||
{media?.path?.indexOf('mp4') > -1 ? (
|
||||
<VideoFrame url={mediaDirectory.set(media?.path)} />
|
||||
) : (
|
||||
<img
|
||||
className="w-full h-full object-cover"
|
||||
src={mediaDirectory.set(media?.path)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<div
|
||||
onClick={clearMedia(index)}
|
||||
className="rounded-full w-[15px] h-[15px] bg-red-800 text-white flex justify-center items-center absolute -end-[4px] -top-[4px]"
|
||||
>
|
||||
x
|
||||
</div>
|
||||
</div>
|
||||
</Fragment>
|
||||
))}
|
||||
</ReactSortable>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-[12px] text-red-400">{error}</div>
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ export function MultipartFileUploader({
|
|||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function useUppyUploader(props: {
|
||||
// @ts-ignore
|
||||
onUploadSuccess: (result: UploadResult) => void;
|
||||
|
|
@ -120,67 +121,6 @@ export function useUppyUploader(props: {
|
|||
});
|
||||
});
|
||||
|
||||
// required thumbnails
|
||||
uppy2.addPreProcessor(async (fileIDs) => {
|
||||
return new Promise<boolean>(async (resolve, reject) => {
|
||||
const findVideos = uppy2
|
||||
.getFiles()
|
||||
.filter((f) => fileIDs.includes(f.id))
|
||||
.filter((f) => f.type?.startsWith('video/'));
|
||||
|
||||
if (findVideos.length === 0) {
|
||||
resolve(true);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const currentVideo of findVideos) {
|
||||
const resolvedVideo = await new Promise<Blob>((resolve, reject) => {
|
||||
const video = document.createElement('video');
|
||||
const url = URL.createObjectURL(currentVideo.data);
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
video.addEventListener('loadedmetadata', () => {
|
||||
const duration = video.duration;
|
||||
const randomTime = Math.random() * duration;
|
||||
|
||||
video.currentTime = randomTime;
|
||||
|
||||
video.addEventListener('seeked', function capture() {
|
||||
canvas.width = video.videoWidth;
|
||||
canvas.height = video.videoHeight;
|
||||
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
||||
|
||||
canvas.toBlob((blob) => {
|
||||
resolve(blob);
|
||||
});
|
||||
// Cleanup
|
||||
video.removeEventListener('seeked', capture);
|
||||
URL.revokeObjectURL(url);
|
||||
});
|
||||
});
|
||||
|
||||
video.src = url;
|
||||
});
|
||||
|
||||
uppy2.addFile({
|
||||
name: `thumbnail-${Date.now()}.jpg`,
|
||||
type: 'image/jpeg',
|
||||
data: resolvedVideo,
|
||||
meta: {
|
||||
thumbnail: true,
|
||||
videoId: currentVideo.id,
|
||||
},
|
||||
isRemote: false,
|
||||
});
|
||||
}
|
||||
|
||||
// add the new thumbnail to uppy seperate from the file
|
||||
|
||||
resolve(true);
|
||||
});
|
||||
});
|
||||
|
||||
const { plugin, options } = getUppyUploadPlugin(
|
||||
transloadit.length > 0 ? 'transloadit' : storageProvider,
|
||||
fetch,
|
||||
|
|
|
|||
|
|
@ -28,15 +28,10 @@ import { UpDownArrow } from '@gitroom/frontend/components/launches/up.down.arrow
|
|||
import { deleteDialog } from '@gitroom/react/helpers/delete.dialog';
|
||||
import { useExistingData } from '@gitroom/frontend/components/launches/helpers/use.existing.data';
|
||||
import { useCopilotAction, useCopilotReadable } from '@copilotkit/react-core';
|
||||
import {
|
||||
LinkedinCompany,
|
||||
LinkedinCompanyPop,
|
||||
ShowLinkedinCompany,
|
||||
} from '@gitroom/frontend/components/launches/helpers/linkedin.component';
|
||||
import { DropEvent, FileRejection, useDropzone } from 'react-dropzone';
|
||||
import { LinkedinCompanyPop } from '@gitroom/frontend/components/launches/helpers/linkedin.component';
|
||||
import { useDropzone } from 'react-dropzone';
|
||||
import { useUppyUploader } from '@gitroom/frontend/components/media/new.uploader';
|
||||
import { UploadResult } from '@uppy/core';
|
||||
import { Dashboard, ProgressBar } from '@uppy/react';
|
||||
import { Dashboard } from '@uppy/react';
|
||||
export const EditorWrapper: FC<{
|
||||
totalPosts: number;
|
||||
value: string;
|
||||
|
|
@ -261,102 +256,108 @@ export const EditorWrapper: FC<{
|
|||
return null;
|
||||
}
|
||||
|
||||
return items.map((g, index) => (
|
||||
<div key={g.id} className="relative flex flex-col gap-[10px]">
|
||||
{!canEdit && !isCreateSet && (
|
||||
<div
|
||||
onClick={() => {
|
||||
if (index !== 0) {
|
||||
return;
|
||||
}
|
||||
return (
|
||||
<div className="relative flex flex-col gap-[20px]">
|
||||
{items.map((g, index) => (
|
||||
<div key={g.id} className="relative flex flex-col gap-[20px]">
|
||||
{!canEdit && !isCreateSet && (
|
||||
<div
|
||||
onClick={() => {
|
||||
if (index !== 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
setLoaded(false);
|
||||
addRemoveInternal(current);
|
||||
}}
|
||||
className="select-none cursor-pointer absolute w-full h-full left-0 top-0 bg-red-600/10 z-[100]"
|
||||
>
|
||||
{index === 0 && (
|
||||
<div className="absolute left-[50%] top-[50%] bg-red-400 -translate-x-[50%] z-[101] -translate-y-[50%] border-dashed border p-[10px] border-black">
|
||||
Edit
|
||||
setLoaded(false);
|
||||
addRemoveInternal(current);
|
||||
}}
|
||||
className="select-none cursor-pointer absolute w-full h-full left-0 top-0 bg-red-600/10 z-[100]"
|
||||
>
|
||||
{index === 0 && (
|
||||
<div className="absolute left-[50%] top-[50%] bg-red-400 -translate-x-[50%] z-[101] -translate-y-[50%] border-dashed border p-[10px] border-black">
|
||||
Edit
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="flex gap-[5px]">
|
||||
<div className="flex-1">
|
||||
<Editor
|
||||
allValues={items}
|
||||
onChange={changeValue(index)}
|
||||
key={index}
|
||||
num={index}
|
||||
totalPosts={global.length}
|
||||
value={g.content}
|
||||
pictures={g.media}
|
||||
setImages={changeImages(index)}
|
||||
autoComplete={canEdit}
|
||||
validateChars={true}
|
||||
identifier={internalFromAll?.identifier || 'global'}
|
||||
totalChars={totalChars}
|
||||
appendImages={appendImages(index)}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col items-center gap-[10px]">
|
||||
<UpDownArrow
|
||||
isUp={index !== 0}
|
||||
isDown={index !== items.length - 1}
|
||||
onChange={changeOrder(index)}
|
||||
/>
|
||||
{index === 0 &&
|
||||
current !== 'global' &&
|
||||
canEdit &&
|
||||
!existingData.integration && (
|
||||
<svg
|
||||
onClick={goBackToGlobal}
|
||||
className="cursor-pointer"
|
||||
data-tooltip-id="tooltip"
|
||||
data-tooltip-content="Go back to global mode"
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 32 32"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M16 3C13.4288 3 10.9154 3.76244 8.77759 5.1909C6.63975 6.61935 4.97351 8.64968 3.98957 11.0251C3.00563 13.4006 2.74819 16.0144 3.2498 18.5362C3.75141 21.0579 4.98953 23.3743 6.80762 25.1924C8.6257 27.0105 10.9421 28.2486 13.4638 28.7502C15.9856 29.2518 18.5995 28.9944 20.9749 28.0104C23.3503 27.0265 25.3807 25.3603 26.8091 23.2224C28.2376 21.0846 29 18.5712 29 16C28.9964 12.5533 27.6256 9.24882 25.1884 6.81163C22.7512 4.37445 19.4467 3.00364 16 3ZM12.7038 21H19.2963C18.625 23.2925 17.5 25.3587 16 26.9862C14.5 25.3587 13.375 23.2925 12.7038 21ZM12.25 19C11.9183 17.0138 11.9183 14.9862 12.25 13H19.75C20.0817 14.9862 20.0817 17.0138 19.75 19H12.25ZM5.00001 16C4.99914 14.9855 5.13923 13.9759 5.41626 13H10.2238C9.92542 14.9889 9.92542 17.0111 10.2238 19H5.41626C5.13923 18.0241 4.99914 17.0145 5.00001 16ZM19.2963 11H12.7038C13.375 8.7075 14.5 6.64125 16 5.01375C17.5 6.64125 18.625 8.7075 19.2963 11ZM21.7763 13H26.5838C27.1388 14.9615 27.1388 17.0385 26.5838 19H21.7763C22.0746 17.0111 22.0746 14.9889 21.7763 13ZM25.7963 11H21.3675C20.8572 8.99189 20.0001 7.0883 18.835 5.375C20.3236 5.77503 21.7119 6.48215 22.9108 7.45091C24.1097 8.41967 25.0926 9.62861 25.7963 11ZM13.165 5.375C11.9999 7.0883 11.1428 8.99189 10.6325 11H6.20376C6.90741 9.62861 7.89029 8.41967 9.08918 7.45091C10.2881 6.48215 11.6764 5.77503 13.165 5.375ZM6.20376 21H10.6325C11.1428 23.0081 11.9999 24.9117 13.165 26.625C11.6764 26.225 10.2881 25.5178 9.08918 24.5491C7.89029 23.5803 6.90741 22.3714 6.20376 21ZM18.835 26.625C20.0001 24.9117 20.8572 23.0081 21.3675 21H25.7963C25.0926 22.3714 24.1097 23.5803 22.9108 24.5491C21.7119 25.5178 20.3236 26.225 18.835 26.625Z"
|
||||
fill="#ef4444"
|
||||
/>
|
||||
</svg>
|
||||
)}
|
||||
{items.length > 1 && (
|
||||
<svg
|
||||
onClick={deletePost(index)}
|
||||
className="cursor-pointer"
|
||||
data-tooltip-id="tooltip"
|
||||
data-tooltip-content="Delete Post"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 14 14"
|
||||
fill="currentColor"
|
||||
>
|
||||
<path
|
||||
d="M11.8125 2.625H9.625V2.1875C9.625 1.8394 9.48672 1.50556 9.24058 1.25942C8.99444 1.01328 8.6606 0.875 8.3125 0.875H5.6875C5.3394 0.875 5.00556 1.01328 4.75942 1.25942C4.51328 1.50556 4.375 1.8394 4.375 2.1875V2.625H2.1875C2.07147 2.625 1.96019 2.67109 1.87814 2.75314C1.79609 2.83519 1.75 2.94647 1.75 3.0625C1.75 3.17853 1.79609 3.28981 1.87814 3.37186C1.96019 3.45391 2.07147 3.5 2.1875 3.5H2.625V11.375C2.625 11.6071 2.71719 11.8296 2.88128 11.9937C3.04538 12.1578 3.26794 12.25 3.5 12.25H10.5C10.7321 12.25 10.9546 12.1578 11.1187 11.9937C11.2828 11.8296 11.375 11.6071 11.375 11.375V3.5H11.8125C11.9285 3.5 12.0398 3.45391 12.1219 3.37186C12.2039 3.28981 12.25 3.17853 12.25 3.0625C12.25 2.94647 12.2039 2.83519 12.1219 2.75314C12.0398 2.67109 11.9285 2.625 11.8125 2.625ZM5.25 2.1875C5.25 2.07147 5.29609 1.96019 5.37814 1.87814C5.46019 1.79609 5.57147 1.75 5.6875 1.75H8.3125C8.42853 1.75 8.53981 1.79609 8.62186 1.87814C8.70391 1.96019 8.75 2.07147 8.75 2.1875V2.625H5.25V2.1875ZM10.5 11.375H3.5V3.5H10.5V11.375ZM6.125 5.6875V9.1875C6.125 9.30353 6.07891 9.41481 5.99686 9.49686C5.91481 9.57891 5.80353 9.625 5.6875 9.625C5.57147 9.625 5.46019 9.57891 5.37814 9.49686C5.29609 9.41481 5.25 9.30353 5.25 9.1875V5.6875C5.25 5.57147 5.29609 5.46019 5.37814 5.37814C5.46019 5.29609 5.57147 5.25 5.6875 5.25C5.80353 5.25 5.91481 5.29609 5.99686 5.37814C6.07891 5.46019 6.125 5.57147 6.125 5.6875ZM8.75 5.6875V9.1875C8.75 9.30353 8.70391 9.41481 8.62186 9.49686C8.53981 9.57891 8.42853 9.625 8.3125 9.625C8.19647 9.625 8.08519 9.57891 8.00314 9.49686C7.92109 9.41481 7.875 9.30353 7.875 9.1875V5.6875C7.875 5.57147 7.92109 5.46019 8.00314 5.37814C8.08519 5.29609 8.19647 5.25 8.3125 5.25C8.42853 5.25 8.53981 5.29609 8.62186 5.37814C8.70391 5.46019 8.75 5.57147 8.75 5.6875Z"
|
||||
fill="#ef4444"
|
||||
<div className="flex gap-[5px]">
|
||||
<div className="flex-1">
|
||||
<Editor
|
||||
allValues={items}
|
||||
onChange={changeValue(index)}
|
||||
key={index}
|
||||
num={index}
|
||||
totalPosts={global.length}
|
||||
value={g.content}
|
||||
pictures={g.media}
|
||||
setImages={changeImages(index)}
|
||||
autoComplete={canEdit}
|
||||
validateChars={true}
|
||||
identifier={internalFromAll?.identifier || 'global'}
|
||||
totalChars={totalChars}
|
||||
appendImages={appendImages(index)}
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="flex flex-col items-center gap-[10px]">
|
||||
<UpDownArrow
|
||||
isUp={index !== 0}
|
||||
isDown={index !== items.length - 1}
|
||||
onChange={changeOrder(index)}
|
||||
/>
|
||||
{index === 0 &&
|
||||
current !== 'global' &&
|
||||
canEdit &&
|
||||
!existingData.integration && (
|
||||
<svg
|
||||
onClick={goBackToGlobal}
|
||||
className="cursor-pointer"
|
||||
data-tooltip-id="tooltip"
|
||||
data-tooltip-content="Go back to global mode"
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 32 32"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M16 3C13.4288 3 10.9154 3.76244 8.77759 5.1909C6.63975 6.61935 4.97351 8.64968 3.98957 11.0251C3.00563 13.4006 2.74819 16.0144 3.2498 18.5362C3.75141 21.0579 4.98953 23.3743 6.80762 25.1924C8.6257 27.0105 10.9421 28.2486 13.4638 28.7502C15.9856 29.2518 18.5995 28.9944 20.9749 28.0104C23.3503 27.0265 25.3807 25.3603 26.8091 23.2224C28.2376 21.0846 29 18.5712 29 16C28.9964 12.5533 27.6256 9.24882 25.1884 6.81163C22.7512 4.37445 19.4467 3.00364 16 3ZM12.7038 21H19.2963C18.625 23.2925 17.5 25.3587 16 26.9862C14.5 25.3587 13.375 23.2925 12.7038 21ZM12.25 19C11.9183 17.0138 11.9183 14.9862 12.25 13H19.75C20.0817 14.9862 20.0817 17.0138 19.75 19H12.25ZM5.00001 16C4.99914 14.9855 5.13923 13.9759 5.41626 13H10.2238C9.92542 14.9889 9.92542 17.0111 10.2238 19H5.41626C5.13923 18.0241 4.99914 17.0145 5.00001 16ZM19.2963 11H12.7038C13.375 8.7075 14.5 6.64125 16 5.01375C17.5 6.64125 18.625 8.7075 19.2963 11ZM21.7763 13H26.5838C27.1388 14.9615 27.1388 17.0385 26.5838 19H21.7763C22.0746 17.0111 22.0746 14.9889 21.7763 13ZM25.7963 11H21.3675C20.8572 8.99189 20.0001 7.0883 18.835 5.375C20.3236 5.77503 21.7119 6.48215 22.9108 7.45091C24.1097 8.41967 25.0926 9.62861 25.7963 11ZM13.165 5.375C11.9999 7.0883 11.1428 8.99189 10.6325 11H6.20376C6.90741 9.62861 7.89029 8.41967 9.08918 7.45091C10.2881 6.48215 11.6764 5.77503 13.165 5.375ZM6.20376 21H10.6325C11.1428 23.0081 11.9999 24.9117 13.165 26.625C11.6764 26.225 10.2881 25.5178 9.08918 24.5491C7.89029 23.5803 6.90741 22.3714 6.20376 21ZM18.835 26.625C20.0001 24.9117 20.8572 23.0081 21.3675 21H25.7963C25.0926 22.3714 24.1097 23.5803 22.9108 24.5491C21.7119 25.5178 20.3236 26.225 18.835 26.625Z"
|
||||
fill="#ef4444"
|
||||
/>
|
||||
</svg>
|
||||
)}
|
||||
{items.length > 1 && (
|
||||
<svg
|
||||
onClick={deletePost(index)}
|
||||
className="cursor-pointer"
|
||||
data-tooltip-id="tooltip"
|
||||
data-tooltip-content="Delete Post"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 14 14"
|
||||
fill="currentColor"
|
||||
>
|
||||
<path
|
||||
d="M11.8125 2.625H9.625V2.1875C9.625 1.8394 9.48672 1.50556 9.24058 1.25942C8.99444 1.01328 8.6606 0.875 8.3125 0.875H5.6875C5.3394 0.875 5.00556 1.01328 4.75942 1.25942C4.51328 1.50556 4.375 1.8394 4.375 2.1875V2.625H2.1875C2.07147 2.625 1.96019 2.67109 1.87814 2.75314C1.79609 2.83519 1.75 2.94647 1.75 3.0625C1.75 3.17853 1.79609 3.28981 1.87814 3.37186C1.96019 3.45391 2.07147 3.5 2.1875 3.5H2.625V11.375C2.625 11.6071 2.71719 11.8296 2.88128 11.9937C3.04538 12.1578 3.26794 12.25 3.5 12.25H10.5C10.7321 12.25 10.9546 12.1578 11.1187 11.9937C11.2828 11.8296 11.375 11.6071 11.375 11.375V3.5H11.8125C11.9285 3.5 12.0398 3.45391 12.1219 3.37186C12.2039 3.28981 12.25 3.17853 12.25 3.0625C12.25 2.94647 12.2039 2.83519 12.1219 2.75314C12.0398 2.67109 11.9285 2.625 11.8125 2.625ZM5.25 2.1875C5.25 2.07147 5.29609 1.96019 5.37814 1.87814C5.46019 1.79609 5.57147 1.75 5.6875 1.75H8.3125C8.42853 1.75 8.53981 1.79609 8.62186 1.87814C8.70391 1.96019 8.75 2.07147 8.75 2.1875V2.625H5.25V2.1875ZM10.5 11.375H3.5V3.5H10.5V11.375ZM6.125 5.6875V9.1875C6.125 9.30353 6.07891 9.41481 5.99686 9.49686C5.91481 9.57891 5.80353 9.625 5.6875 9.625C5.57147 9.625 5.46019 9.57891 5.37814 9.49686C5.29609 9.41481 5.25 9.30353 5.25 9.1875V5.6875C5.25 5.57147 5.29609 5.46019 5.37814 5.37814C5.46019 5.29609 5.57147 5.25 5.6875 5.25C5.80353 5.25 5.91481 5.29609 5.99686 5.37814C6.07891 5.46019 6.125 5.57147 6.125 5.6875ZM8.75 5.6875V9.1875C8.75 9.30353 8.70391 9.41481 8.62186 9.49686C8.53981 9.57891 8.42853 9.625 8.3125 9.625C8.19647 9.625 8.08519 9.57891 8.00314 9.49686C7.92109 9.41481 7.875 9.30353 7.875 9.1875V5.6875C7.875 5.57147 7.92109 5.46019 8.00314 5.37814C8.08519 5.29609 8.19647 5.25 8.3125 5.25C8.42853 5.25 8.53981 5.29609 8.62186 5.37814C8.70391 5.46019 8.75 5.57147 8.75 5.6875Z"
|
||||
fill="#ef4444"
|
||||
/>
|
||||
</svg>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{canEdit ? (
|
||||
<AddPostButton
|
||||
num={index}
|
||||
onClick={addValue(index)}
|
||||
postComment={postComment}
|
||||
/>
|
||||
) : (
|
||||
<div className="h-[25px]" />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{canEdit ? (
|
||||
<AddPostButton
|
||||
num={index}
|
||||
onClick={addValue(index)}
|
||||
postComment={postComment}
|
||||
/>
|
||||
) : <div className="h-[25px]" />}
|
||||
))}
|
||||
</div>
|
||||
));
|
||||
);
|
||||
};
|
||||
|
||||
export const Editor: FC<{
|
||||
|
|
@ -475,6 +476,14 @@ export const Editor: FC<{
|
|||
</div>
|
||||
</div>
|
||||
<div className="relative">
|
||||
{validateChars && props.value.length < 6 && (
|
||||
<div className="px-3 text-sm bg-red-600 !text-white mb-[4px]">
|
||||
{t(
|
||||
'the_post_should_be_at_least_6_characters_long',
|
||||
'The post should be at least 6 characters long'
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div {...getRootProps()}>
|
||||
<div
|
||||
className={clsx(
|
||||
|
|
@ -525,16 +534,8 @@ export const Editor: FC<{
|
|||
<div className="w-full h-[46px] pointer-events-none" />
|
||||
</div>
|
||||
</div>
|
||||
{validateChars && props.value.length < 6 && (
|
||||
<div className="px-3 text-sm bg-red-600 !text-white mb-[4px]">
|
||||
{t(
|
||||
'the_post_should_be_at_least_6_characters_long',
|
||||
'The post should be at least 6 characters long'
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex gap-[5px] bg-customColor2">
|
||||
<div className="flex bg-customColor2">
|
||||
{setImages && (
|
||||
<MultiMediaComponent
|
||||
allData={allValues}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ export const ThirdPartyMedia: FC<{
|
|||
<div className="relative group">
|
||||
<Button
|
||||
className={clsx(
|
||||
'relative ms-[10px] !px-[10px] rounded-[4px] mb-[10px] gap-[8px] !text-primary justify-center items-center flex border border-dashed border-customColor21 bg-input'
|
||||
'relative ms-[10px] !px-[10px] rounded-[4px] gap-[8px] !text-primary justify-center items-center flex border border-dashed border-customColor21 bg-input'
|
||||
)}
|
||||
onClick={() => setPopup(true)}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export class MediaRepository {
|
|||
constructor(private _media: PrismaRepository<'media'>) {}
|
||||
|
||||
saveFile(org: string, fileName: string, filePath: string) {
|
||||
const file = fileName.split('.');
|
||||
return this._media.model.media.create({
|
||||
data: {
|
||||
organization: {
|
||||
|
|
@ -15,6 +16,15 @@ export class MediaRepository {
|
|||
},
|
||||
name: fileName,
|
||||
path: filePath,
|
||||
...(fileName.indexOf('mp4') > -1
|
||||
? { thumbnail: `${file[0]}.thumbnail.jpg` }
|
||||
: {}),
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
path: true,
|
||||
thumbnail: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -60,6 +70,12 @@ export class MediaRepository {
|
|||
orderBy: {
|
||||
createdAt: 'desc',
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
path: true,
|
||||
thumbnail: true,
|
||||
},
|
||||
skip: pageNum * 28,
|
||||
take: 28,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -202,6 +202,7 @@ model Media {
|
|||
path String
|
||||
organization Organization @relation(fields: [organizationId], references: [id])
|
||||
organizationId String
|
||||
thumbnail String?
|
||||
fileSize Int @default(0)
|
||||
type String @default("image")
|
||||
createdAt DateTime @default(now())
|
||||
|
|
@ -210,6 +211,7 @@ model Media {
|
|||
agencies SocialMediaAgency[]
|
||||
deletedAt DateTime?
|
||||
|
||||
@@index([name])
|
||||
@@index([organizationId])
|
||||
@@index([type])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export const VideoFrame: FC<{
|
|||
const { url } = props;
|
||||
return (
|
||||
<video
|
||||
className="w-full h-full object-cover"
|
||||
className="w-full h-full object-cover rounded-[4px]"
|
||||
src={url + '#t=0.1'}
|
||||
preload="metadata"
|
||||
autoPlay={false}
|
||||
|
|
|
|||
Loading…
Reference in New Issue