Profile picture frontend + backend
This commit is contained in:
@@ -187,9 +187,11 @@ export default class API {
|
||||
return res;
|
||||
}
|
||||
|
||||
async uploadPicture(file, scale=1.0) {
|
||||
async uploadPicture(file, size, x = 0, y = 0) {
|
||||
const formData = new FormData();
|
||||
formData.append("scale", scale);
|
||||
formData.append("size", size);
|
||||
formData.append("x", x);
|
||||
formData.append("y", y);
|
||||
formData.append("picture", file, file.name);
|
||||
let res = await this.apiCall("user/uploadPicture", formData);
|
||||
if (res.success) {
|
||||
|
||||
@@ -13,6 +13,8 @@ const PicturePlaceholderBox = styled(Box)((props) => ({
|
||||
alignItems: "center",
|
||||
background: "radial-gradient(circle closest-side, gray 98%, transparent 100%);",
|
||||
containerType: "inline-size",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
"& > span": {
|
||||
textAlign: "center",
|
||||
fontSize: "30cqw",
|
||||
|
||||
Reference in New Issue
Block a user