This commit is contained in:
1 parent
8efd032cc6
commit
df38dccbf1
735 files changed
+128321
-120870
No files matched your search
+22
-12
@@ -19,19 +19,29 @@ import type { AvatarOptions } from "@/types/admin";
|
||||
* getAvatarUrl(look, { size: 'l', headOnly: true })
|
||||
* getAvatarUrl(look, { size: 'm', gesture: 'sml', direction: 2 })
|
||||
*/
|
||||
export function getAvatarUrl(figure: string, options: AvatarOptions = {}): string {
|
||||
const { size = "m", direction = 2, headDirection = 3, headOnly = false, gesture, action } = options;
|
||||
export function getAvatarUrl(
|
||||
figure: string,
|
||||
options: AvatarOptions = {},
|
||||
): string {
|
||||
const {
|
||||
size = "m",
|
||||
direction = 2,
|
||||
headDirection = 3,
|
||||
headOnly = false,
|
||||
gesture,
|
||||
action,
|
||||
} = options;
|
||||
|
||||
const params = new URLSearchParams({
|
||||
figure,
|
||||
direction: String(direction),
|
||||
head_direction: String(headDirection),
|
||||
size,
|
||||
});
|
||||
const params = new URLSearchParams({
|
||||
figure,
|
||||
direction: String(direction),
|
||||
head_direction: String(headDirection),
|
||||
size,
|
||||
});
|
||||
|
||||
if (headOnly) params.set("headonly", "1");
|
||||
if (gesture) params.set("gesture", gesture);
|
||||
if (action) params.set("action", action);
|
||||
if (headOnly) params.set("headonly", "1");
|
||||
if (gesture) params.set("gesture", gesture);
|
||||
if (action) params.set("action", action);
|
||||
|
||||
return `${IMAGER_URL}?${params.toString()}`;
|
||||
return `${IMAGER_URL}?${params.toString()}`;
|
||||
}
|
||||
Reference in new issue
Block a user