Skip to content

Commit

Permalink
EG
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Feb 9, 2025
1 parent db985cf commit 9f18c2d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
13 changes: 11 additions & 2 deletions servicedesk-gui/src/components/UnitHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import React from "react";
import React, {useState} from "react";
import "./UnitHeader.scss";
import Frontdesk from "../icons/frontdesk.svg";

export const UnitHeader = ({obj, children}) => {

const [isAnimating, setIsAnimating] = useState(false);

const toggleAnimation = () => {
setIsAnimating(true);
setTimeout(() => setIsAnimating(false), 2250);
}

return (
<div className="unit-header-container">
<div className="unit-header">
<div className={`image ${obj.style || ""}`}>
<div className={`image ${obj.style || ""} ${isAnimating ? "animated" : ""}`}
onClick={toggleAnimation}>
<Frontdesk/>
</div>
<div className="obj-name">
Expand Down
31 changes: 31 additions & 0 deletions servicedesk-gui/src/components/UnitHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,43 @@
border-radius: 5px;
border: 1px solid var(--sds--color--gray--300);

@keyframes rainbow {
0% {
fill: red;
}
14% {
fill: orange;
}
28% {
fill: yellow;
}
42% {
fill: green;
}
57% {
fill: blue;
}
71% {
fill: indigo;
}
85% {
fill: violet;
}
100% {
fill: red;
}
}

svg {
height: 76px;
width: auto;
margin-bottom: auto;
}

&.animated svg {
animation: rainbow 2s linear ;
}

&.small {
svg {
width: 28px;
Expand Down
2 changes: 1 addition & 1 deletion servicedesk-gui/src/tabs/Control.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const Control = ({restart, proceed}) => {
onChange={val => confirm(4, val)}/>
</div>
{!validDayOfBirth &&
<div className={`validation-item-inner birthday ${birthDay === null ? "invalid" : ""}`}>
<div className={`validation-item-inner birthday ${birthDay === null ? "invalid" : "valid"}`}>
<p>{I18n.t(`control.${birthDay === null ? "invalidDate" : "validDate"}`)}</p>
<DatePicker
ref={inputRef}
Expand Down
4 changes: 4 additions & 0 deletions servicedesk-gui/src/tabs/Control.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ div.control {
&.invalid {
color: var(--sds--color--red--400);
}

&.valid {
font-weight: 600;
}
}

.sds--tooltip-parent {
Expand Down

0 comments on commit 9f18c2d

Please sign in to comment.