fix: some issue

This commit is contained in:
Kilu 2024-08-29 17:03:08 +08:00
parent d89804f3e4
commit d2c3e348a1
4 changed files with 8 additions and 24 deletions

View File

@ -59,17 +59,6 @@ function AsTemplate ({
await loadTemplate(); await loadTemplate();
} }
notify.info({
type: 'success',
title: t('template.uploadSuccess'),
message: t('template.uploadSuccessDescription'),
okText: t('template.viewTemplate'),
onOk: () => {
const url = import.meta.env.AF_BASE_URL?.includes('test') ? 'https://test.appflowy.io' : 'https://appflowy.io';
window.open(`${url}/templates/${selectedCategoryIds[0]}/${viewId}`, '_blank');
},
});
handleBack(); handleBack();
} catch (error) { } catch (error) {
// eslint-disable-next-line // eslint-disable-next-line
@ -77,8 +66,7 @@ function AsTemplate ({
notify.error(error.toString()); notify.error(error.toString());
} }
}, [service, selectedCreatorId, selectedCategoryIds, viewId, isNewTemplate, isFeatured, viewUrl, template, t, handleBack, loadTemplate]); }, [service, selectedCreatorId, selectedCategoryIds, isNewTemplate, isFeatured, viewId, viewUrl, template, loadTemplate, handleBack]);
const submitRef = React.useRef<HTMLInputElement>(null); const submitRef = React.useRef<HTMLInputElement>(null);
useEffect(() => { useEffect(() => {

View File

@ -2,8 +2,6 @@ import { TemplateSummary, TemplateCategory } from '@/application/template.type';
import CreatorAvatar from '@/components/as-template/creator/CreatorAvatar'; import CreatorAvatar from '@/components/as-template/creator/CreatorAvatar';
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
const url = import.meta.env.AF_BASE_URL?.includes('test') ? 'https://test.appflowy.io' : 'https://appflowy.io';
function TemplateItem ({ template, category }: { template: TemplateSummary; category: TemplateCategory }) { function TemplateItem ({ template, category }: { template: TemplateSummary; category: TemplateCategory }) {
const iframeUrl = useMemo(() => { const iframeUrl = useMemo(() => {
const url = new URL(template.view_url); const url = new URL(template.view_url);
@ -17,16 +15,14 @@ function TemplateItem ({ template, category }: { template: TemplateSummary; cate
return ( return (
<> <>
<a <div
href={`${url}/templates/${category.id}/${template.view_id}`}
className={'relative rounded-[16px] pt-4 px-4 h-[230px] w-full overflow-hidden'} className={'relative rounded-[16px] pt-4 px-4 h-[230px] w-full overflow-hidden'}
target={'_blank'}
style={{ style={{
backgroundColor: category?.bg_color, backgroundColor: category?.bg_color,
}} }}
> >
<iframe loading={'lazy'} className={'w-full h-full'} src={iframeUrl} /> <iframe loading={'lazy'} className={'w-full h-full'} src={iframeUrl} />
</a> </div>
<div className={'template-info'}> <div className={'template-info'}>
<div className={'template-creator'}> <div className={'template-creator'}>
<div className={'avatar'}> <div className={'avatar'}>

View File

@ -15,7 +15,7 @@ export function Event({ event }: EventWrapperProps<CalendarEvent>) {
return ( return (
<div className={'px-1 py-0.5'}> <div className={'px-1 py-0.5'}>
<RichTooltip content={<EventPaper rowId={rowId} />} open={open} placement='right' onClose={() => setOpen(false)}> <RichTooltip content={<EventPaper rowId={rowId} />} open={open} placement="right" onClose={() => setOpen(false)}>
<div <div
onClick={() => { onClick={() => {
if (window.innerWidth < 768) { if (window.innerWidth < 768) {
@ -25,7 +25,7 @@ export function Event({ event }: EventWrapperProps<CalendarEvent>) {
} }
}} }}
className={ className={
'flex min-h-[24px] cursor-pointer flex-col gap-2 rounded-md border border-line-border bg-bg-body p-2 text-xs text-xs shadow-sm hover:bg-fill-list-active hover:shadow' 'flex min-h-[24px] cursor-pointer flex-col gap-2 rounded-md border border-line-divider bg-bg-body p-2 text-xs shadow-sm hover:bg-fill-list-active hover:shadow'
} }
> >
{showFields.map((field) => { {showFields.map((field) => {

View File

@ -10,7 +10,7 @@ import Breadcrumb from './Breadcrumb';
import { ReactComponent as Logo } from '@/assets/logo.svg'; import { ReactComponent as Logo } from '@/assets/logo.svg';
import MoreActions from './MoreActions'; import MoreActions from './MoreActions';
import { ReactComponent as SideOutlined } from '@/assets/side_outlined.svg'; import { ReactComponent as SideOutlined } from '@/assets/side_outlined.svg';
// import { Duplicate } from './duplicate'; import { Duplicate } from './duplicate';
export const HEADER_HEIGHT = 48; export const HEADER_HEIGHT = 48;
@ -113,7 +113,7 @@ export function PublishViewHeader ({ onOpenDrawer, openDrawer }: { onOpenDrawer:
<div className={'flex items-center gap-2'}> <div className={'flex items-center gap-2'}>
<MoreActions /> <MoreActions />
{/*<Duplicate />*/} <Duplicate />
<Divider orientation={'vertical'} className={'mx-2'} flexItem /> <Divider orientation={'vertical'} className={'mx-2'} flexItem />
<Tooltip title={t('publish.downloadApp')}> <Tooltip title={t('publish.downloadApp')}>
<button onClick={openOrDownload}> <button onClick={openOrDownload}>