-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb001de
commit ba697c5
Showing
13 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const copyStaticFiles = require('esbuild-copy-static-files'); | ||
|
||
module.exports = function (config) { | ||
config.plugins.push( | ||
copyStaticFiles({ | ||
src: './static', | ||
dest: config.outdir, | ||
}), | ||
); | ||
return config; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as React from 'react'; | ||
import type { ExtensionComponentProps } from 'spa-app'; | ||
|
||
interface ProfileData { | ||
user: any; | ||
logout: any; | ||
} | ||
|
||
const Profile: React.FC<ExtensionComponentProps<ProfileData>> = ({ params }) => { | ||
const { user, logout } = params; | ||
const exit = (e: React.SyntheticEvent) => { | ||
e.preventDefault(); | ||
logout(); | ||
}; | ||
|
||
return ( | ||
<div style={{ display: 'flex', flexDirection: 'row', gap: '0.5rem' }}> | ||
<img src={user.icon} width="24" height="24" /> | ||
<span>{user.name}</span> | ||
<a href="#" onClick={exit}> | ||
🚪 | ||
</a> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Profile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import { PiletApi } from 'spa-app'; | ||
import type { PiletApi } from 'spa-app'; | ||
import Profile from './Profile'; | ||
|
||
export function setup(api: PiletApi) {} | ||
export function setup(api: PiletApi) { | ||
api.registerExtension('user-profile-menu', Profile); | ||
} |