Skip to content

Commit f96acb2

Browse files
Redesign Huly loading screen (#10189)
* Redesign Huly loading screen Signed-off-by: Artem Savchenko <[email protected]> * Update copyright Signed-off-by: Artem Savchenko <[email protected]> * Use square spinner Signed-off-by: Artem Savchenko <[email protected]> --------- Signed-off-by: Artem Savchenko <[email protected]>
1 parent e10a05b commit f96acb2

File tree

6 files changed

+432
-5
lines changed

6 files changed

+432
-5
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!--
2+
// Copyright © 2025 Hardcore Engineering Inc.
3+
//
4+
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License. You may
6+
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
//
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
-->
15+
<script lang="ts">
16+
import { createEventDispatcher, onMount } from 'svelte'
17+
import SquareSpinner from './icons/SquareSpinner.svelte'
18+
19+
export let shrink: boolean = false
20+
export let label: string = ''
21+
export let size: 'small' | 'medium' | 'large' = 'small'
22+
23+
const dispatch = createEventDispatcher()
24+
let timer: any
25+
onMount(() => {
26+
timer = setTimeout(() => {
27+
dispatch('progress')
28+
}, 50)
29+
return () => {
30+
clearTimeout(timer)
31+
}
32+
})
33+
</script>
34+
35+
<div class="spinner-container" class:fullSize={!shrink}>
36+
<div data-label={label} class="flex-row-center flex-gap-2" class:labeled={label !== ''}>
37+
<SquareSpinner {size} />
38+
<slot />
39+
</div>
40+
</div>
41+
42+
<style lang="scss">
43+
.spinner-container {
44+
display: flex;
45+
justify-content: center;
46+
align-items: center;
47+
48+
&.fullSize {
49+
width: 100%;
50+
height: 100%;
51+
}
52+
}
53+
</style>

packages/ui/src/components/Component.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import type { AnyComponent, AnySvelteComponent } from '../types'
2020
import ErrorPresenter from './ErrorPresenter.svelte'
2121
import Loading from './Loading.svelte'
22+
import AppLoading from './AppLoading.svelte'
2223
import ErrorBoundary from './internal/ErrorBoundary'
2324
import { clone } from '@hcengineering/core'
2425
@@ -30,6 +31,7 @@
3031
export let showLoading = true
3132
export let inline: boolean = false
3233
export let disabled: boolean = false
34+
export let appLoading: boolean = false
3335
3436
let _is: AnyComponent | AnySvelteComponent = is
3537
@@ -105,7 +107,11 @@
105107
{#if _is != null}
106108
{#if loading}
107109
{#if showLoading}
108-
<Loading {shrink} />
110+
{#if appLoading}
111+
<AppLoading {shrink} />
112+
{:else}
113+
<Loading {shrink} />
114+
{/if}
109115
{/if}
110116
{:else if Ctor != null}
111117
<ErrorBoundary bind:error>

0 commit comments

Comments
 (0)