mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 20:12:10 +00:00
get color from app
This commit is contained in:
@@ -16,6 +16,20 @@ const props = withDefaults(defineProps<RoomExperienceProps>(), {
|
|||||||
const page = usePage();
|
const page = usePage();
|
||||||
const presenterMode = ref(false);
|
const presenterMode = ref(false);
|
||||||
const roomNotice = computed(() => page.props.roomNotice);
|
const roomNotice = computed(() => page.props.roomNotice);
|
||||||
|
const embeddedBackgroundColor = computed(() => {
|
||||||
|
if (!props.embedded) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const backgroundColor = new URL(
|
||||||
|
page.url,
|
||||||
|
'https://embedded.invalid',
|
||||||
|
).searchParams.get('background_color');
|
||||||
|
|
||||||
|
return backgroundColor && /^#[0-9a-f]{6}$/i.test(backgroundColor)
|
||||||
|
? backgroundColor
|
||||||
|
: undefined;
|
||||||
|
});
|
||||||
const canFavorite = computed(
|
const canFavorite = computed(
|
||||||
() => !props.embedded && page.props.auth.user?.id != props.room.owner_id,
|
() => !props.embedded && page.props.auth.user?.id != props.room.owner_id,
|
||||||
);
|
);
|
||||||
@@ -35,6 +49,11 @@ const {
|
|||||||
|
|
||||||
<main
|
<main
|
||||||
class="min-h-svh bg-slate-900 px-3 py-6 text-white sm:px-6 md:flex md:min-h-0 md:flex-col md:overflow-hidden lg:px-10"
|
class="min-h-svh bg-slate-900 px-3 py-6 text-white sm:px-6 md:flex md:min-h-0 md:flex-col md:overflow-hidden lg:px-10"
|
||||||
|
:style="
|
||||||
|
embeddedBackgroundColor
|
||||||
|
? { backgroundColor: embeddedBackgroundColor }
|
||||||
|
: undefined
|
||||||
|
"
|
||||||
:class="
|
:class="
|
||||||
embedded
|
embedded
|
||||||
? 'md:h-dvh'
|
? 'md:h-dvh'
|
||||||
|
|||||||
Reference in New Issue
Block a user