Skip to content

Commit

Permalink
feat:修复webcontainer部署时的header错误,修改默认头像 (xun082#97)
Browse files Browse the repository at this point in the history
* fix: 修复webcontainer header错误

* feat: 修改默认头像
  • Loading branch information
coderz-w authored Jul 31, 2024
1 parent 76b3c90 commit 9ecc91b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 31 deletions.
13 changes: 0 additions & 13 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ const nextConfig = {
},
],
},
{
source: '/(.*)',
headers: [
{
key: 'Cross-Origin-Embedder-Policy',
value: '',
},
{
key: 'Cross-Origin-Opener-Policy',
value: '',
},
],
},
];
},
};
Expand Down
Binary file added public/kunkun.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/edit/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface HeaderProps {
projectId: string;
}

export const Header: React.FC<HeaderProps> = ({ userInfo, projectId }) => {
export const Header: React.FC<HeaderProps> = ({ projectId }) => {
const [projectName, setProjectName] = useState('');
useEffect(() => {
const projectData = localStorage.getItem(projectId)
Expand Down Expand Up @@ -61,7 +61,7 @@ export const Header: React.FC<HeaderProps> = ({ userInfo, projectId }) => {
</div>
<div className="mr-4">
<AvatarPopover>
<Avatar src={userInfo.imgurl} className=" flex h-[3.5vh] w-[3.5vh]" />
<Avatar src="/kunkun.gif" className=" flex h-[3.6vh] w-[3.6vh]" />
</AvatarPopover>
</div>
<WebContainerProvider projectId={projectId}></WebContainerProvider>
Expand Down
4 changes: 2 additions & 2 deletions src/components/main/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ interface HeaderProps {}

export const Header: React.FC<HeaderProps> = () => {
return (
<header className="flex flex-row items-center w-[100vw] justify-between bg-transparent py-4 px-12 z-[999]">
<header className="flex flex-row items-center w-[100vw] justify-between bg-transparent py-4 px-12 pr-4 z-[999]">
<Link className=" text-white font-bold" href="/">
{PROJECT_Name}
</Link>
<AvatarPopover>
<Avatar className="flex h-[3.5vh] w-[3.5vh]" />
<Avatar src="/kunkun.gif" className="flex h-[3.5vh] w-[3.5vh]" />
</AvatarPopover>
</header>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/modals/create-project-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const CreateProjectModal = () => {
{Object.keys(templateList).map((item) => {
return (
<div
key={item}
className=" flex w-full rounded-sm p-2 transition-all cursor-pointer hover:bg-black/80"
onClick={() => {
setUploadFileState(templateList[item].template);
Expand Down
15 changes: 1 addition & 14 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"headers": [
{
"source": "/edit/(.*)",
"source": "/(.*)",
"headers": [
{
"key": "Cross-Origin-Embedder-Policy",
Expand All @@ -18,19 +18,6 @@
"value": "same-origin"
}
]
},
{
"source": "/_next/static/(.*)",
"headers": [
{
"key": "Cross-Origin-Embedder-Policy",
"value": ""
},
{
"key": "Cross-Origin-Opener-Policy",
"value": ""
}
]
}
]
}

0 comments on commit 9ecc91b

Please sign in to comment.