Skip to content

Commit

Permalink
fix: some issue
Browse files Browse the repository at this point in the history
  • Loading branch information
qinluhe committed Aug 29, 2024
1 parent d89804f commit d2c3e34
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,14 @@ function AsTemplate ({
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();
} catch (error) {
// eslint-disable-next-line
// @ts-ignore
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);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { TemplateSummary, TemplateCategory } from '@/application/template.type';
import CreatorAvatar from '@/components/as-template/creator/CreatorAvatar';
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 }) {
const iframeUrl = useMemo(() => {
const url = new URL(template.view_url);
Expand All @@ -17,16 +15,14 @@ function TemplateItem ({ template, category }: { template: TemplateSummary; cate

return (
<>
<a
href={`${url}/templates/${category.id}/${template.view_id}`}
<div
className={'relative rounded-[16px] pt-4 px-4 h-[230px] w-full overflow-hidden'}
target={'_blank'}
style={{
backgroundColor: category?.bg_color,
}}
>
<iframe loading={'lazy'} className={'w-full h-full'} src={iframeUrl} />
</a>
</div>
<div className={'template-info'}>
<div className={'template-creator'}>
<div className={'avatar'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CardField from '@/components/database/components/field/CardField';
import React from 'react';
import { EventWrapperProps } from 'react-big-calendar';

export function Event({ event }: EventWrapperProps<CalendarEvent>) {
export function Event ({ event }: EventWrapperProps<CalendarEvent>) {
const { id } = event;
const [rowId] = id.split(':');
const showFields = useFieldsSelector();
Expand All @@ -15,7 +15,7 @@ export function Event({ event }: EventWrapperProps<CalendarEvent>) {

return (
<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)}>

Check warning on line 18 in frontend/appflowy_web_app/src/components/database/components/calendar/event/Event.tsx

View check run for this annotation

Codecov / codecov/patch

frontend/appflowy_web_app/src/components/database/components/calendar/event/Event.tsx#L18

Added line #L18 was not covered by tests
<div
onClick={() => {
if (window.innerWidth < 768) {
Expand All @@ -25,7 +25,7 @@ export function Event({ event }: EventWrapperProps<CalendarEvent>) {
}
}}
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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Breadcrumb from './Breadcrumb';
import { ReactComponent as Logo } from '@/assets/logo.svg';
import MoreActions from './MoreActions';
import { ReactComponent as SideOutlined } from '@/assets/side_outlined.svg';
// import { Duplicate } from './duplicate';
import { Duplicate } from './duplicate';

export const HEADER_HEIGHT = 48;

Expand Down Expand Up @@ -113,7 +113,7 @@ export function PublishViewHeader ({ onOpenDrawer, openDrawer }: { onOpenDrawer:
<div className={'flex items-center gap-2'}>

<MoreActions />
{/*<Duplicate />*/}
<Duplicate />
<Divider orientation={'vertical'} className={'mx-2'} flexItem />
<Tooltip title={t('publish.downloadApp')}>
<button onClick={openOrDownload}>
Expand Down

0 comments on commit d2c3e34

Please sign in to comment.