Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 添加github链接 #136

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/app/(main)/(router)/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function DashboardPage() {
<div className="flex flex-col gap-y-5">
<span className="text-[32px] font-[800] leading-[38.2px]">欢迎使用 Online Edit</span>
<span className="text-[14px] text-[#c7ccd6]">
一款集成 AI 能力的 Online IDE,提供开箱即用的开发环境,简化开发过程,提高效率
一款基于 Webcontainer 的 Online IDE,提供开箱即用的开发环境,简化开发过程,提高效率
</span>
</div>
<div className="relative flex flex-col pt-6 px-6 w-full h-[40vh] rounded-lg overflow-hidden">
Expand Down Expand Up @@ -95,7 +95,7 @@ export default function DashboardPage() {
))}
</div>
</div>
<p className="text-[#737780] text-[14px]">阅读文档了解如何使用</p>
<p className="text-[#737780] text-[14px]">更多开源项目</p>
<div className="flex gap-x-4 items-center justify-center w-full mt-[-3vh]">
{LinkCardData.map((item) => (
<LinkCard
Expand Down Expand Up @@ -157,7 +157,7 @@ const TemplateCard: React.FC<{ title: string; fileData: string; icon: string }>
return (
<div
key={title}
className="group relative h-[20vh] py-[16px] px-[16px] duration-200 transition-all rounded-[8px] hover:rounded-[16px] hover:bg-black/50 bg-black/40 overflow-hidden flex flex-col w-1/3 cursor-pointer"
className="group relative h-[20vh] py-[16px] px-[16px] transition-all duration-100 rounded-[8px] hover:rounded-[16px] hover:bg-black/50 bg-black/40 overflow-hidden flex flex-col w-1/3 cursor-pointer"
>
<div className="flex items-center h-[28px]">
<div className="w-[28px] h-[28px] rounded-[6px] flex items-center justify-center">
Expand All @@ -173,7 +173,7 @@ const TemplateCard: React.FC<{ title: string; fileData: string; icon: string }>
<div className="mt-[16px]">
<div
onClick={() => quickStartProject()}
className="bg-tr-1 bg-white/5 text-[14px] group-hover:bg-white/15 w-full font-[600] rounded-[4px] py-[5px] px-[16px] text-center"
className="bg-tr-1 bg-white/5 text-[14px] duration-200 group-hover:bg-white/15 w-full font-[600] rounded-[4px] py-[5px] px-[16px] text-center"
>
体验
</div>
Expand Down Expand Up @@ -205,7 +205,7 @@ const LinkCard: React.FC<{ linkText: string; linkUrl: string; linkDesc: string }
height="16"
fill="none"
viewBox="0 0 16 16"
className="hidden group-hover:inline-block"
className="hidden duration-200 group-hover:inline-block"
>
<path
fill="#ADB0B8"
Expand Down Expand Up @@ -233,7 +233,7 @@ const ProjectCard: React.FC<{ projectData: any }> = ({ projectData }) => {
onClick={() => {
handleDirectToEdit();
}}
className=" flex justify-between py-4 px-5 rounded-[6px] cursor-pointer transition-all bg-[#24262b] hover:bg-[#33363d]"
className=" flex justify-between py-4 px-5 rounded-[6px] cursor-pointer transition-all duration-200 bg-[#24262b] hover:bg-[#33363d]"
>
<div className="flex gap-5 items-center">
<div className="flex items-center justify-center">
Expand Down
9 changes: 0 additions & 9 deletions src/app/(main)/(router)/templates/page.tsx

This file was deleted.

14 changes: 7 additions & 7 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,37 @@ const projects = [
icon: '/react.svg',
title: 'React',
description: 'JavaScript',
link: '/a',
link: '/',
},
{
icon: '/react.svg',
title: 'React',
description: 'TypeScript',
link: '/b',
link: '/',
},
{
icon: '/vue.svg',
title: 'Vue',
description: 'JavaScript',
link: '/c',
link: '/',
},
{
icon: '/vue.svg',
title: 'Vue',
description: 'TypeScript',
link: '/d',
link: '/',
},
{
icon: '/preact.svg',
title: 'Preact',
description: 'JavaScript',
link: '/e',
link: '/',
},
{
icon: '/preact.svg',
title: 'Preact',
description: 'TypeScript',
link: '/f',
link: '/',
},
{
icon: '/node.svg',
Expand All @@ -70,7 +70,7 @@ const socialIcons = [
},
{
icon: <RiTwitterXFill className="w-6 h-6" />,
link: 'https://github.com/xun082/online-edit-web111',
link: 'https://github.com/xun082/online-edit-web',
},
];

Expand Down
9 changes: 7 additions & 2 deletions src/components/edit/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Link from 'next/link';
import React, { useEffect, useState } from 'react';
import { VscLiveShare } from 'react-icons/vsc';
import { FaRegSave } from 'react-icons/fa';
import { FaGithub, FaRegSave } from 'react-icons/fa';
import { GoRepoForked } from 'react-icons/go';
import localforage from 'localforage';

Expand Down Expand Up @@ -34,7 +34,7 @@ export const Header: React.FC<HeaderProps> = ({ projectId }) => {
}, []);

return (
<header className=" relative flex flex-row items-center w-[100vw] justify-between bg-transparent py-4 z-[999]">
<header className=" relative flex flex-row items-center w-[100vw] justify-between bg-transparent py-4">
<Link className=" text-white font-bold ml-3" href="/">
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -63,6 +63,11 @@ export const Header: React.FC<HeaderProps> = ({ projectId }) => {
<div className=" flex items-center justify-center w-full absolute leading-[5vh] font-[500] text-[16px] pointer-events-none">
{projectName}
</div>
<div className=" mr-6">
<a href={'https://github.com/xun082/online-edit-web'} className="p-2 rounded-md">
<FaGithub className="w-[3.6vh] h-[3.6vh]" />
</a>
</div>
<div className="mr-4">
<AvatarPopover>
<Avatar src="/kunkun.gif" className=" flex h-[3.6vh] w-[3.6vh]" />
Expand Down
6 changes: 4 additions & 2 deletions src/components/home/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ const Partners: LinkProps[] = [
];
// 渲染链接
const renderLink = (products: LinkProps[]) =>
products.map((item) => (
products.map((item, idx) => (
<li>
<Link href={item.link}>{item.name}</Link>
<Link key={item.link + idx} href={item.link}>
{item.name}
</Link>
</li>
));

Expand Down
8 changes: 4 additions & 4 deletions src/components/home/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ interface HeaderRouter {
}

const renderIcon = (icons: Icon[]) =>
icons.map((icon) => (
<a href={icon.link} key={icon.link} className="p-2 rounded-md text-[#ffffff]">
icons.map((icon, idx) => (
<a href={icon.link} key={icon.link + idx} className="p-2 rounded-md text-[#ffffff]">
{icon.icon}
</a>
));

const renderRouter = (router: HeaderRouter[]) =>
router.map((item) => (
router.map((item, idx) => (
<Link
href={item.link}
key={item.link}
key={item.link + idx}
className="p-2 rounded-md hover:text-white text-white/60 font-medium"
>
{item.title}
Expand Down
12 changes: 9 additions & 3 deletions src/components/main/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Link from 'next/link';
import React from 'react';
import { FaGithub } from 'react-icons/fa';

import { Avatar } from '@/components/common/Avatar';
import AvatarPopover from '@/components/avatarPopover';
Expand All @@ -13,9 +14,14 @@ export const Header: React.FC<HeaderProps> = () => {
<Link className=" text-white font-bold" href="/">
{PROJECT_Name}
</Link>
<AvatarPopover>
<Avatar src="/kunkun.gif" className="flex h-[3.5vh] w-[3.5vh]" />
</AvatarPopover>
<div className=" flex gap-x-3">
<a href={'https://github.com/xun082/online-edit-web'} className="p-2 rounded-md">
<FaGithub className="w-[3.5vh] h-[3.5vh]" />
</a>
<AvatarPopover>
<Avatar src="/kunkun.gif" className="flex h-[3.5vh] w-[3.5vh]" />
</AvatarPopover>
</div>
</header>
);
};
25 changes: 10 additions & 15 deletions src/utils/route.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { GoFileDirectory } from 'react-icons/go';
import { MdComputer } from 'react-icons/md';

import { PATHS } from './constants';

Expand All @@ -15,11 +14,6 @@ export const RouterDataList: RouterData[] = [
icon: <GoFileDirectory className=" w-6 text-[16px] mr-3" />,
link: PATHS.MAIN_DASHBOARD,
},
{
title: '文档',
icon: <MdComputer className=" w-6 text-[16px] mr-3" />,
link: PATHS.MAIN_TEMPLATES,
},
];

export const TemplateCardData = [
Expand All @@ -39,18 +33,19 @@ export const TemplateCardData = [

export const LinkCardData = [
{
linkText: 'link1',
linkUrl: 'https://www.baidu.com',
linkDesc: 'desc1',
linkText: 'create-neat',
linkUrl: 'https://github.com/xun082/create-neat',
linkDesc: '基于 PNPM 和 Turborepo 的前端脚手架,旨在快速为用户创建各种类型的项目',
},
{
linkText: 'lin2',
linkUrl: 'https://www.baidu.com',
linkDesc: 'desc1',
linkText: 'create-ai-toolkit',
linkUrl: 'https://github.com/xun082/create-ai-toolkit',
linkDesc:
'AI驱动的前端开发工具,集成组件和钩子生成、自动提交信息和代码审查,提升开发效率和代码质量',
},
{
linkText: 'lin3',
linkUrl: 'https://www.baidu.com',
linkDesc: 'desc3',
linkText: 'online-edit-server',
linkUrl: 'https://github.com/xun082/online-edit-server',
linkDesc: '在线编辑器的后端',
},
];
Loading