-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add new ThemeSwitcher logic #9698
Changes from all commits
b14361e
b916700
efb42cb
9493526
81f5735
d6057f6
e5f9e0e
8200545
44854b6
8831f15
38b1017
84d34e0
ccf1628
f4bf391
0233377
1de5a55
2544143
9669005
58dd4ec
ccf3493
13e5308
2513032
60e0822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Change: Theme handling | ||
|
||
The handling of themes has been throughoutly reworked. | ||
Themes now feature a human-readable title, can specify whether they are suitable as light or dark mode themes. | ||
If only one theme is provided, this theme will be set. | ||
If two themes are provided and one is a dark and one is a light mode one, there is a light/dark mode switch button in the AppBar. | ||
If more than two themes are provided or the two provided themes are not a dark and a light mode one respectively, | ||
the UI features a theme-switch button featuring a dropdown of the human-readable names of the available themes | ||
|
||
https://github.com/owncloud/web/issues/2404 | ||
https://github.com/owncloud/web/issues/8424 | ||
https://github.com/owncloud/web/issues/9403 | ||
https://github.com/owncloud/web/issues/9885 | ||
https://github.com/owncloud/web/issues/9939 | ||
https://github.com/owncloud/web/pull/8855 | ||
https://github.com/owncloud/web/pull/9396 | ||
https://github.com/owncloud/web/pull/9401 | ||
https://github.com/owncloud/web/pull/9698 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,15 +28,16 @@ | |
</div> | ||
|
||
<div class="oc-text-center oc-mt-xxl"> | ||
<p v-text="configuration.currentTheme.general.slogan" /> | ||
<p v-text="themeSlogan" /> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { storeToRefs } from 'pinia' | ||
import { mapGetters } from 'vuex' | ||
import { createLocationPublic, createLocationSpaces } from '@ownclouders/web-pkg' | ||
import { createLocationPublic, createLocationSpaces, useThemeStore } from '@ownclouders/web-pkg' | ||
import ResourceUpload from '../components/AppBar/Upload/ResourceUpload.vue' | ||
import { | ||
computed, | ||
|
@@ -78,6 +79,7 @@ export default defineComponent({ | |
setup() { | ||
const uppyService = useService<UppyService>('$uppyService') | ||
const store = useStore() | ||
const themeStore = useThemeStore() | ||
const router = useRouter() | ||
const route = useRoute() | ||
const language = useGettext() | ||
|
@@ -89,6 +91,9 @@ export default defineComponent({ | |
const { getInternalSpace } = useGetMatchingSpace() | ||
useUpload({ uppyService }) | ||
|
||
const { currentTheme } = storeToRefs(themeStore) | ||
const themeSlogan = computed(() => currentTheme.value.common.slogan) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be computed, as storeToRefs builds already a reactive object, or does this not apply to nested objects? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I understand it: It's not necessary in this case. It doesn't hurt to have a computed here though, I guess it's used as a "shortcut". |
||
|
||
const fileIdQueryItem = useRouteQuery('fileId') | ||
const fileId = computed(() => { | ||
return queryItemAsString(unref(fileIdQueryItem)) | ||
|
@@ -207,7 +212,8 @@ export default defineComponent({ | |
dragareaEnabled, | ||
loading, | ||
errorMessage, | ||
share | ||
share, | ||
themeSlogan | ||
} | ||
}, | ||
computed: { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
"peerDependencies": { | ||
"@ownclouders/design-system": "workspace:*", | ||
"@ownclouders/web-client": "workspace:*", | ||
"@ownclouders/web-pkg": "workspace:*" | ||
"@ownclouders/web-pkg": "workspace:*", | ||
"pinia": "^2.1.7" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps we should re-export the required part (storeToRefs) from web-pkg? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO it's fine to have |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './extensionRegistry' | ||
export * from './theme' |
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.
I guess the config for this has been removed intentionally? Because then we need to remove it in oCIS as well.
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.
Yes, we should. The way to go is the theme, so that all clients can use the URLs. Config is only for web.