Skip to content
This repository was archived by the owner on Jul 23, 2023. It is now read-only.

Commit 49f710e

Browse files
committed
Add mod descriptions
1 parent 2a0aa63 commit 49f710e

File tree

6 files changed

+19
-2
lines changed

6 files changed

+19
-2
lines changed

app/components/Mods/ModTableRow.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
TableRow,
66
Chip,
77
Tooltip,
8+
Typography,
89
} from '@material-ui/core';
910

1011
import { useRecoilValue } from 'recoil';
@@ -24,6 +25,9 @@ const useStyles = makeStyles((theme) => ({
2425
missingDependencyRow: {
2526
background: theme.palette.secondary.dark,
2627
},
28+
modDescription: {
29+
color: theme.palette.text.disabled,
30+
},
2731
}));
2832

2933
const ModTableRow: React.FunctionComponent<Props> = ({ mod }) => {
@@ -76,7 +80,14 @@ const ModTableRow: React.FunctionComponent<Props> = ({ mod }) => {
7680
return (
7781
<Tooltip title={getRowTooltip()}>
7882
<TableRow className={getClassName()} key={mod.uniqueName}>
79-
<TableCell>{mod.name}</TableCell>
83+
<TableCell>
84+
<Typography variant="subtitle1">
85+
{mod.name}
86+
</Typography>
87+
<Typography className={styles.modDescription} variant="caption">
88+
{mod.description}
89+
</Typography>
90+
</TableCell>
8091
<TableCell>{mod.author}</TableCell>
8192
<TableCell align="right">{mod.downloadCount}</TableCell>
8293
<TableCell>

app/globals.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type Mod = {
1616
errors: string[];
1717
dependencies: string[];
1818
requireVR?: boolean;
19+
description?: string;
1920
};
2021

2122
type ModMap = { [uniqueName: string]: Mod };
@@ -38,6 +39,7 @@ type Manifest = {
3839
version: string;
3940
dependencies?: string[];
4041
requireVR?: boolean;
42+
description?: string;
4143
};
4244

4345
type ModConfig = {

app/services/get-local-mods.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function getOwmlSync(owmlPath: string) {
2424
isRequired: true,
2525
errors: [],
2626
dependencies: [],
27+
description: owmlManifest?.description,
2728
};
2829
return owml;
2930
}
@@ -54,6 +55,7 @@ export function getLocalModsSync(owmlPath: string) {
5455
errors: [],
5556
dependencies: manifest.dependencies ?? [],
5657
requireVR: manifest.requireVR,
58+
description: manifest.description,
5759
};
5860

5961
if (missingAttributes.length > 0) {

app/services/get-mod-database.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export async function getModDatabase(
6262
repo,
6363
dependencies: manifest.dependencies ?? [],
6464
isRequired: required,
65+
description: manifest.description,
6566
};
6667

6768
if (missingAttributes.length > 0) {

app/services/manifest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function manifestPartialToFull(partialManifest: Partial<Manifest>) {
1919
version: getAttribute('version'),
2020
dependencies: partialManifest.dependencies ?? [],
2121
requireVR: partialManifest.requireVR ?? false,
22+
description: partialManifest.description,
2223
};
2324

2425
return {

app/static-text.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const modsText = {
3939
findModsLabel: 'Find mods',
4040
emptyModList: 'No mods here! 😱',
4141
tableHead: {
42-
name: 'Name',
42+
name: 'Mod',
4343
author: 'Author',
4444
downloadCount: 'Downloads',
4545
version: 'Version',

0 commit comments

Comments
 (0)