Skip to content

Commit

Permalink
update public & fix form bug & deploy frontend on ic
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyuanxun committed Dec 16, 2023
1 parent 4eee957 commit 9746930
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 20 deletions.
3 changes: 3 additions & 0 deletions canister_ids.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
},
"likeFetch" : {
"ic" : "leoia-xiaaa-aaaan-qgjyq-cai"
},
"frontend" : {
"ic" : "2f64i-aaaaa-aaaan-qiu4q-cai"
}
}
7 changes: 7 additions & 0 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@
"declarations": {
"node_compatibility": true
}
},
"frontend": {
"frontend": {
"entrypoint": "frontend/build/index.html"
},
"source": ["frontend/build"],
"type": "assets"
}
},
"defaults": {
Expand Down
Binary file removed frontend/public/favicon.ico
Binary file not shown.
8 changes: 4 additions & 4 deletions frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="%PUBLIC_URL%/logo.jpg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="Proton"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!-- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> -->
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Proton</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file added frontend/public/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed frontend/public/logo192.png
Binary file not shown.
Binary file removed frontend/public/logo512.png
Binary file not shown.
20 changes: 5 additions & 15 deletions frontend/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Proton",
"name": "Proton App",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
"src": "logo.jpg",
"type": "image/jpg",
"sizes": "400x400"
}
],
"start_url": ".",
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Modal/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export default function ProfileForm(props: ProfileFormProps) {
const [form] = Form.useForm();
const [api, contextHolder] = notification.useNotification();
const {principal} = useAuth()
console.log(props.userProfile)
console.log(props.userProfile?.feedCanister);

const onFinish = async (values: any) => {
api.info({
Expand Down Expand Up @@ -95,7 +97,7 @@ export default function ProfileForm(props: ProfileFormProps) {
education: props.userProfile?.education,
backImgUrl: props.userProfile?.backImgUrl,
avatarUrl: props.userProfile?.avatarUrl,
feedCanister: props.userProfile?.feedCanister[0]?.toString(),
feedCanister: (props.userProfile?.feedCanister !== undefined && props.userProfile?.feedCanister.length > 0) ? props.userProfile?.feedCanister[0]?.toString() : "",
biography: props.userProfile?.biography
}}
style={{maxWidth: 600}}
Expand Down

0 comments on commit 9746930

Please sign in to comment.