Skip to content

Commit

Permalink
loading spinner update
Browse files Browse the repository at this point in the history
  • Loading branch information
hussaino03 committed Dec 23, 2024
1 parent 5d923eb commit 803f1aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 1 addition & 9 deletions client/src/components/Leaderboard/Leaderboard.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import React, { useState, useEffect, memo } from 'react';
import { PresentationChartLineIcon } from '@heroicons/react/24/outline';
import LeaderboardManager from '../../services/leaderboard/LeaderboardManager';

const LoadingSpinner = memo(() => (
<div className="flex items-center justify-center p-4">
<svg className="animate-spin h-5 w-5 text-blue-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
</div>
));
import { LoadingSpinner } from '../../utils/spinner';

const MetricBox = memo(({ label, value }) => (
<div className="p-3 rounded-lg bg-gray-50 dark:bg-gray-700/50 border border-gray-100 dark:border-gray-600 flex items-center justify-between sm:block">
Expand Down
10 changes: 10 additions & 0 deletions client/src/utils/spinner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { memo } from 'react';

export const LoadingSpinner = memo(() => (
<div className="flex items-center justify-center p-4">
<svg className="animate-spin h-5 w-5 text-blue-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
</div>
));

0 comments on commit 803f1aa

Please sign in to comment.