Skip to content

Commit eadd674

Browse files
authored
Merge pull request #8517 from sagemathinc/next-fix-buttons-8266
next/software: tweak software img line selection buttons
2 parents 85467d4 + 7227a0f commit eadd674

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/packages/next/pages/software/index.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6-
import { Button, Layout, Space } from "antd";
6+
import { Layout, Radio } from "antd";
77

88
import {
99
LanguageName,
@@ -19,6 +19,8 @@ import A from "components/misc/A";
1919
import { MAX_WIDTH } from "lib/config";
2020
import { Customize } from "lib/customize";
2121
import withCustomize from "lib/with-customize";
22+
23+
// Images
2224
import juliaLogo from "public/features/julia-logo.svg";
2325
import sageScreenshot from "public/features/sage-worksheet.png";
2426
import executablesScreenshot from "public/software/executables.png";
@@ -56,24 +58,26 @@ const LINKS: { [lang in LanguageName | "executables"]: string } = {
5658
function renderSoftwareEnvLinks(lang: LanguageName | "executables") {
5759
return (
5860
<Paragraph>
59-
<Space>
61+
<Radio.Group
62+
optionType="button"
63+
size="small"
64+
value={SOFTWARE_ENV_DEFAULT}
65+
buttonStyle="solid"
66+
>
6067
{SOFTWARE_ENV_NAMES.map((name) => {
61-
const type = SOFTWARE_ENV_DEFAULT === name ? "primary" : undefined;
62-
const style = type === "primary" ? { fontWeight: "bold" } : {};
6368
// toLowerCase is necessary for R → r
6469
const href = `/software/${lang.toLowerCase()}/${name}`;
6570
return (
66-
<Button
67-
size="small"
68-
type={type}
69-
href={href}
70-
style={{ ...style, padding: "5px" }}
71+
<Radio.Button
72+
key={name}
73+
value={name}
74+
onClick={() => (window.location.href = href)}
7175
>
7276
{name}
73-
</Button>
77+
</Radio.Button>
7478
);
7579
})}
76-
</Space>
80+
</Radio.Group>
7781
</Paragraph>
7882
);
7983
}

0 commit comments

Comments
 (0)