Skip to content

Commit

Permalink
fix(editor): Minor styling improvements in project settings page (#12405
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MiloradFilipovic authored Dec 30, 2024
1 parent 1674dd0 commit 09ddce0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
40 changes: 17 additions & 23 deletions packages/editor-ui/src/components/Projects/ProjectHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,18 @@ const onSelect = (action: string) => {
<template>
<div>
<div :class="[$style.projectHeader]">
<ProjectIcon :icon="headerIcon" size="medium" />
<div>
<N8nHeading bold tag="h2" size="xlarge">{{ projectName }}</N8nHeading>
<N8nText color="text-light">
<slot name="subtitle">
<span v-if="!projectsStore.currentProject">{{
i18n.baseText('projects.header.subtitle')
}}</span>
</slot>
</N8nText>
<div :class="[$style.projectDetails]">
<ProjectIcon :icon="headerIcon" :border-less="true" size="medium" />
<div>
<N8nHeading bold tag="h2" size="xlarge">{{ projectName }}</N8nHeading>
<N8nText color="text-light">
<slot name="subtitle">
<span v-if="!projectsStore.currentProject">{{
i18n.baseText('projects.header.subtitle')
}}</span>
</slot>
</N8nText>
</div>
</div>
<div v-if="route.name !== VIEWS.PROJECT_SETTINGS" :class="[$style.headerActions]">
<N8nTooltip
Expand Down Expand Up @@ -148,25 +150,17 @@ const onSelect = (action: string) => {
.projectHeader {
display: flex;
align-items: center;
gap: 8px;
justify-content: space-between;
padding-bottom: var(--spacing-m);
min-height: 64px;
}
.headerActions {
margin-left: auto;
min-height: var(--spacing-3xl);
}
.icon {
border: 1px solid var(--color-foreground-light);
padding: 6px;
border-radius: var(--border-radius-base);
.projectDetails {
display: flex;
align-items: center;
}
.actions {
display: flex;
justify-content: space-between;
align-items: flex-end;
padding: var(--spacing-2xs) 0 var(--spacing-l);
}
</style>
20 changes: 16 additions & 4 deletions packages/editor-ui/src/components/Projects/ProjectIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ type Props = {
icon: ProjectIcon;
size?: 'small' | 'medium' | 'large';
round?: boolean;
borderLess?: boolean;
};
const props = withDefaults(defineProps<Props>(), {
size: 'medium',
round: false,
borderLess: false,
});
</script>
<template>
<div :class="[$style.container, $style[props.size], { [$style.round]: props.round }]">
<div
:class="[
$style.container,
$style[props.size],
{ [$style.round]: props.round, [$style.borderless]: props.borderLess },
]"
>
<N8nIcon
v-if="props.icon.type === 'icon'"
:icon="props.icon.value"
Expand All @@ -36,10 +44,14 @@ const props = withDefaults(defineProps<Props>(), {
&.round {
border-radius: 50%;
}
&.borderless {
border: none;
}
}
.small {
width: var(--spacing-l);
min-width: var(--spacing-l);
height: var(--spacing-l);
.emoji {
Expand All @@ -48,7 +60,7 @@ const props = withDefaults(defineProps<Props>(), {
}
.medium {
width: var(--spacing-xl);
min-width: var(--spacing-xl);
height: var(--spacing-xl);
.emoji {
Expand All @@ -58,7 +70,7 @@ const props = withDefaults(defineProps<Props>(), {
.large {
// Making this in line with user avatar size
width: 40px;
min-width: 40px;
height: 40px;
.emoji {
Expand Down

0 comments on commit 09ddce0

Please sign in to comment.