-
Notifications
You must be signed in to change notification settings - Fork 3
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: allow background images #5
base: master
Are you sure you want to change the base?
Conversation
"permissions": [ | ||
"storage" | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this file? it should already exist in the public dir?
@@ -1,3 +1,4 @@ | |||
/// <reference types="chrome"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats this for?
<Particles /> | ||
<img src={settings.themeBackgroundImagePath} /> | ||
<img src={settings.themeBackgroundImageBase64 ? `data:image/jpeg;base64,` + settings.themeBackgroundImageBase64 : ""} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you set it so that the image rendered correctly:
b64Image = btoa(new Uint8Array(result).reduce((data, byte) => data + String.fromCharCode(byte), '')); | ||
setSettingValue('themeBackgroundImageBase64', b64Image); | ||
}; | ||
fileData.readAsArrayBuffer(fileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be better to create separate function so that this can be just `loadImageAsBase64(filePath).then((base64Image) => setSettingValue('themeBackgroundImageBase64', base64Image))
@@ -5,7 +5,7 @@ import db from '../dal/storage'; | |||
export const defaultSettings: Settings = { | |||
themeForegroundColor: 'white', | |||
themeBackgroundColor: 'black', | |||
themeBackgroundImagePath: undefined, | |||
themeBackgroundImageBase64: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For discussion: do you think better to store the base64 somewhere else?
For example, use db.load('backgroundImage').
Then, when we open the devtools, the settings will still be easy to read
No description provided.