From f4317fe98ce4638352d8ffec4918d6da221ce111 Mon Sep 17 00:00:00 2001
From: Mathias Aas <54811233+Mathias-a@users.noreply.github.com>
Date: Thu, 17 Oct 2024 21:56:32 +0200
Subject: [PATCH 01/53] 1441 loading indicator for recruitment statistics
(#1527)
* add loader, make page less ugly, but still ugly
---
.../SamfundetLogoSpinner.module.scss | 33 +++--
.../SamfundetLogoSpinner.tsx | 9 +-
.../RecruitmentStatistics.module.scss | 17 ++-
.../RecruitmentStatistics.tsx | 114 ++++++++++++------
frontend/src/api.ts | 4 +-
frontend/src/hooks.ts | 27 ++++-
6 files changed, 146 insertions(+), 58 deletions(-)
diff --git a/frontend/src/Components/SamfundetLogoSpinner/SamfundetLogoSpinner.module.scss b/frontend/src/Components/SamfundetLogoSpinner/SamfundetLogoSpinner.module.scss
index f44f7955f..e1c0397c3 100644
--- a/frontend/src/Components/SamfundetLogoSpinner/SamfundetLogoSpinner.module.scss
+++ b/frontend/src/Components/SamfundetLogoSpinner/SamfundetLogoSpinner.module.scss
@@ -2,6 +2,30 @@
@import 'src/mixins';
+.center {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+}
+
+.left {
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+}
+
+.right {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+}
+
/* The animation code */
@keyframes spinner-appear-after-delay {
0% {
@@ -61,13 +85,13 @@ $time: 1.75s;
max-width: 5em;
max-height: 5em;
opacity: 0;
- animation: spinner-appear-after-delay .5s 0.25s forwards;
+ animation: spinner-appear-after-delay 0.5s 0.25s forwards;
@include theme-dark {
/* stylelint-disable-next-line function-no-unknown */
color: $black-t90;
}
-
+
// These aren't actually global in the context of the module parent class.
// This is required to ensure class names are not hashed because the
// raw class name string is used in the SamfundetLogo SVG definition
@@ -86,9 +110,4 @@ $time: 1.75s;
transform-origin: center;
animation: inner-anim $time $delay $ease-func infinite normal;
}
-
}
-
-
-
-
diff --git a/frontend/src/Components/SamfundetLogoSpinner/SamfundetLogoSpinner.tsx b/frontend/src/Components/SamfundetLogoSpinner/SamfundetLogoSpinner.tsx
index 001b66e9b..6cb5048a0 100644
--- a/frontend/src/Components/SamfundetLogoSpinner/SamfundetLogoSpinner.tsx
+++ b/frontend/src/Components/SamfundetLogoSpinner/SamfundetLogoSpinner.tsx
@@ -4,9 +4,14 @@ import styles from './SamfundetLogoSpinner.module.scss';
type SamfundetLogoSpinnerProps = {
className?: string;
+ position?: 'center' | 'left' | 'right';
};
-export function SamfundetLogoSpinner({ className }: SamfundetLogoSpinnerProps) {
+export function SamfundetLogoSpinner({ className, position }: SamfundetLogoSpinnerProps) {
const classnames = classNames(className, styles.spinning_logo);
- return