Skip to content

Commit

Permalink
Apply suggestions from code review (resize tiles token & ViewModeCons…
Browse files Browse the repository at this point in the history
…tant type)
  • Loading branch information
pascalwengerter committed Feb 6, 2023
1 parent a70990a commit 385dada
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/design-system/src/tokens/ods/size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ size:
form-check-default:
value: 14px
tiles:
resizeable:
resize-step:
value: 12rem
default:
value: 14rem
4 changes: 2 additions & 2 deletions packages/web-app-files/src/components/AppBar/ViewOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default defineComponent({
})
const viewSizeQuery = useRouteQueryPersisted({
name: ViewModeConstants.tilesSizeQueryName,
defaultValue: ViewModeConstants.tilesSizeDefault
defaultValue: ViewModeConstants.tilesSizeDefault.toString()
})
watch(
[perPageQuery, viewModeQuery],
Expand Down Expand Up @@ -163,7 +163,7 @@ export default defineComponent({
setTilesViewSize() {
document
.querySelector(':root')
.style.setProperty(`--oc-size-tiles-resizeable`, `${this.viewSizeCurrent * 12}rem`)
.style.setProperty(`--oc-size-tiles-resize-step`, `${this.viewSizeCurrent * 12}rem`)
},
updateHiddenFilesShownModel(event) {
this.hiddenFilesShownModel = event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default defineComponent({
row-gap: 1rem;
&.resizeableTiles {
grid-template-columns: repeat(auto-fill, var(--oc-size-tiles-resizeable));
grid-template-columns: repeat(auto-fill, var(--oc-size-tiles-resize-step));
}
@media only screen and (max-width: 640px) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ export abstract class ViewModeConstants {
}
}
static readonly queryName: string = 'view-mode'
static readonly tilesSizeDefault: string = '12rem'
static readonly tilesSizeDefault: number = 1
static readonly tilesSizeQueryName: string = 'tiles-size'
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function useViewSize<T>(options: ComputedRef<string>): ComputedRef<string

const viewModeSize = useRouteQueryPersisted({
name: ViewModeConstants.tilesSizeQueryName,
defaultValue: ViewModeConstants.tilesSizeDefault
defaultValue: ViewModeConstants.tilesSizeDefault.toString()
})
return computed(() => String(unref(viewModeSize)))
}

0 comments on commit 385dada

Please sign in to comment.