Skip to content

Commit 3edd95d

Browse files
Mikadowsangristan
authored andcommitted
feat(ui): change display of component
1 parent 04e175f commit 3edd95d

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

src/components/Benchmarks/BenchmarkDetail.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ const BenchmarkDetail = ({
110110
button="Back"
111111
navTo="/benchmarks"
112112
/>
113-
<div className="flex p-4">
114-
<div className="grid flex-1 ">
115-
{/*<div className="flex-1 mx-auto border-4 border-dashed border-gray-200 rounded-lg h-96 p-4">*/}
113+
<div className="flex p-4 overflow-hidden">
114+
<div className="grid flex-1">
116115
<div className="pl-8 pr-8 border-4 border-dashed border-gray-200 rounded-lg h-96 p-4">
117116
<div className="flex justify-between">
118117
<h1 className="text-2xl pb-3">Subject</h1>
@@ -216,9 +215,7 @@ const BenchmarkDetail = ({
216215
</div>
217216
<ReactMarkdown>{benchmarkData?.subject || ''}</ReactMarkdown>
218217
</div>
219-
<Leaderboard
220-
benchmarkId={benchmarkData?.id ? benchmarkData.id : ''}
221-
/>
218+
222219
</div>
223220
<div className="grid flex-1">
224221
<div className="bg-gray-500 rounded-lg h-96">
@@ -228,24 +225,27 @@ const BenchmarkDetail = ({
228225
value={lastSubmission && lastSubmission}
229226
language={selected.name}
230227
/>
231-
</div>
232-
<div className="justify-self-start ml-10">{result && result}</div>
233-
<div className="justify-self-end flex-1">
234-
<button
235-
className="bg-blue-500 hover:bg-blue-700 text-white font-bold mt-2 py-2 px-4 rounded"
236-
onClick={() => {
237-
mutate({
238-
code: editorRef.current.getValue(),
239-
benchmarkId:
240-
benchmarkData?.id !== undefined ? benchmarkData.id : '',
241-
language: selected.name,
242-
});
243-
}}
244-
>
245-
Run code
246-
</button>
228+
<div className="grid justify-items-stretch">
229+
<button
230+
className="justify-self-end bg-blue-500 hover:bg-blue-700 text-white font-bold mt-2 py-2 px-4 rounded"
231+
onClick={() => {
232+
mutate({
233+
code: editorRef.current.getValue(),
234+
benchmarkId:
235+
benchmarkData?.id !== undefined ? benchmarkData.id : '',
236+
language: selected.name,
237+
});
238+
}}
239+
>
240+
Run code
241+
</button>
242+
</div>
243+
<div className="justify-self-start ml-10">{result && result}</div>
247244
</div>
248245
</div>
246+
<Leaderboard
247+
benchmarkId={benchmarkData?.id ? benchmarkData.id : ''}
248+
/>
249249
</div>
250250
</Page>
251251
);

src/components/leaderboard/Leaderboard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const Leaderboard: React.FC<LeaderboardProps> = ({ benchmarkId }) => {
4646
}
4747

4848
return (
49-
<div className="mt-3 ml-2">
49+
<div className="mt-3 ml-2 flex-1">
5050
<div className="flex justify-between">
5151
<h1 className="text-2xl pb-3 ">Leaderboard</h1>
5252
<div>
@@ -144,11 +144,11 @@ const Leaderboard: React.FC<LeaderboardProps> = ({ benchmarkId }) => {
144144
</Listbox>
145145
</div>
146146
</div>
147-
<div className="ml-2 flex flex-col h-80 scrollbar scrollbar-thumb-gray-900 scrollbar-track-gray-100">
147+
<div className="ml-2 flex flex-col h-screen scrollbar scrollbar-thumb-gray-900 scrollbar-track-gray-100">
148148
<div className="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
149149
<div className="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8">
150150
<div className="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
151-
<table className="min-w-full divide-y divide-gray-200">
151+
<table className=" divide-y divide-gray-200">
152152
<thead className="bg-gray-50">
153153
<tr>
154154
<th

0 commit comments

Comments
 (0)