all developments of milestone 1
This commit is contained in:
@@ -4,11 +4,15 @@ import {
|
||||
ANONYMOUS_ACTOR_ID,
|
||||
ANONYMOUS_PARTICIPATION_CONFIG,
|
||||
ANONYMOUS_REPORTS_CONFIG,
|
||||
DEFAULT_PICTURE,
|
||||
DEMO_MODE,
|
||||
LONG_EVENTS,
|
||||
EVENT_CATEGORIES,
|
||||
EVENT_PARTICIPANTS,
|
||||
FEATURES,
|
||||
GEOCODING_AUTOCOMPLETE,
|
||||
COLORS,
|
||||
INSTANCE_LOGO,
|
||||
LOCATION,
|
||||
MAPS_TILES,
|
||||
REGISTRATIONS,
|
||||
@@ -76,6 +80,36 @@ export function useInstanceName() {
|
||||
return { instanceName, error, loading };
|
||||
}
|
||||
|
||||
export function useInstanceLogoUrl() {
|
||||
const { result, error, loading } = useQuery<{
|
||||
config: Pick<IConfig, "instanceLogo">;
|
||||
}>(INSTANCE_LOGO);
|
||||
|
||||
const instanceLogoUrl = computed(
|
||||
() => result.value?.config?.instanceLogo?.url
|
||||
);
|
||||
return { instanceLogoUrl, error, loading };
|
||||
}
|
||||
|
||||
export function useColors() {
|
||||
const { result, error, loading } = useQuery<{
|
||||
config: Pick<IConfig, "primaryColor" | "secondaryColor">;
|
||||
}>(COLORS);
|
||||
|
||||
const primaryColor = computed(() => result.value?.config?.primaryColor);
|
||||
const secondaryColor = computed(() => result.value?.config?.secondaryColor);
|
||||
return { primaryColor, secondaryColor, error, loading };
|
||||
}
|
||||
|
||||
export function useDefaultPicture() {
|
||||
const { result, error, loading } = useQuery<{
|
||||
config: Pick<IConfig, "defaultPicture">;
|
||||
}>(DEFAULT_PICTURE);
|
||||
|
||||
const defaultPicture = computed(() => result.value?.config?.defaultPicture);
|
||||
return { defaultPicture, error, loading };
|
||||
}
|
||||
|
||||
export function useAnonymousActorId() {
|
||||
const { result, error, loading } = useQuery<{
|
||||
config: Pick<IConfig, "anonymous">;
|
||||
@@ -188,6 +222,15 @@ export function useIsDemoMode() {
|
||||
return { isDemoMode, error, loading };
|
||||
}
|
||||
|
||||
export function useIsLongEvents() {
|
||||
const { result, error, loading } = useQuery<{
|
||||
config: Pick<IConfig, "longEvents">;
|
||||
}>(LONG_EVENTS);
|
||||
|
||||
const islongEvents = computed(() => result.value?.config.longEvents);
|
||||
return { islongEvents, error, loading };
|
||||
}
|
||||
|
||||
export function useAnalytics() {
|
||||
const { result, error, loading } = useQuery<{
|
||||
config: Pick<IConfig, "analytics">;
|
||||
|
||||
@@ -4,6 +4,12 @@ export const useHost = (): string => {
|
||||
return window.location.hostname;
|
||||
};
|
||||
|
||||
export const useDefaultMaxSize = (): number | undefined => {
|
||||
const { uploadLimits } = useUploadLimits();
|
||||
|
||||
return uploadLimits.value?.default;
|
||||
};
|
||||
|
||||
export const useAvatarMaxSize = (): number | undefined => {
|
||||
const { uploadLimits } = useUploadLimits();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user