Skip to content
Snippets Groups Projects
Commit d9da3b6c authored by Tin Geber's avatar Tin Geber
Browse files

if else logic fix

parent 1cd5cfd7
No related branches found
No related tags found
1 merge request!125Improve UX for dashboard app tiles
Pipeline #41298 passed with stages
in 3 minutes and 52 seconds
......@@ -88,36 +88,42 @@ export const Dashboard: React.FC = () => {
</div>
) : null;
const branch = sysInfo.sysInfo.followingGit;
// eslint-disable-next-line
// let branch = 'DF234FD';
const knownMainBranch = 'v2';
const versionInfo =
sysInfo.sysInfo.followingGit === 'v2' ? (
branch === knownMainBranch ? (
<>
<CheckCircleIcon className="h-4 w-4 text-primary-600" />
<span>Stackspin v{sysInfo.sysInfo.version}</span>
</>
) : sysInfo.sysInfo.followingGit !== 'v2' ? null : (
) : branch !== knownMainBranch ? (
<>
<span>Stackspin v{sysInfo.sysInfo.version}</span>
</>
);
) : null;
const updatesText =
sysInfo.sysInfo.followingGit === 'v2' ? (
branch === knownMainBranch ? (
<>
<div className="px-4 py-2 flex items-center gap-1">
<HomeIcon className="w-4 h-4 text-gray-500" />
<span>Using main branch ({sysInfo.sysInfo.followingGit})</span>
<span>Using main branch ({branch})</span>
</div>
<div className="px-4 py-2 flex items-center gap-1">
<RefreshIcon className="w-4 h-4 text-gray-500" />
<span>Automatic updates active</span>
</div>
</>
) : sysInfo.sysInfo.followingGit !== 'v2' ? null : (
) : branch !== knownMainBranch ? (
<div className="px-4 py-2 flex items-center gap-1">
<BeakerIcon className="w-4 h-4 text-gray-500" />
<span>Using custom branch (SHA {sysInfo.sysInfo.version})</span>
<span>Custom branch ({branch})</span>
</div>
);
) : null;
return (
<div className="relative">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment