From 4ec1d3ad82f72947704d37f913ed0930b13a2063 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:05:11 +0000 Subject: [PATCH 1/2] Commit --- tgui/packages/tgui/interfaces/Changelog.jsx | 84 ++++++++++----------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/tgui/packages/tgui/interfaces/Changelog.jsx b/tgui/packages/tgui/interfaces/Changelog.jsx index 5d2fa9447b47..40adabdb733d 100644 --- a/tgui/packages/tgui/interfaces/Changelog.jsx +++ b/tgui/packages/tgui/interfaces/Changelog.jsx @@ -1,39 +1,39 @@ import { classes } from 'common/react'; import { useBackend } from '../backend'; import { Component, Fragment } from 'react'; -import { Box, Button, Dropdown, Icon, Section, Stack, Table } from '../components'; +import { Box, Button, Dropdown, Icon, Section, Stack, Table, Tooltip } from '../components'; import { Window } from '../layouts'; import { resolveAsset } from '../assets'; import dateformat from 'dateformat'; import yaml from 'js-yaml'; -const icons = { - bugfix: { icon: 'bug', color: 'green' }, - fix: { icon: 'bug', color: 'green' }, - wip: { icon: 'hammer', color: 'orange' }, - qol: { icon: 'hand-holding-heart', color: 'green' }, - soundadd: { icon: 'tg-sound-plus', color: 'green' }, - sounddel: { icon: 'tg-sound-minus', color: 'red' }, - add: { icon: 'check-circle', color: 'green' }, - expansion: { icon: 'check-circle', color: 'green' }, - rscadd: { icon: 'check-circle', color: 'green' }, - rscdel: { icon: 'times-circle', color: 'red' }, - imageadd: { icon: 'tg-image-plus', color: 'green' }, - imagedel: { icon: 'tg-image-minus', color: 'red' }, - spellcheck: { icon: 'spell-check', color: 'green' }, - experiment: { icon: 'radiation', color: 'yellow' }, - balance: { icon: 'balance-scale-right', color: 'yellow' }, - code_imp: { icon: 'code', color: 'green' }, - refactor: { icon: 'tools', color: 'green' }, - config: { icon: 'cogs', color: 'purple' }, - admin: { icon: 'user-shield', color: 'purple' }, - server: { icon: 'server', color: 'purple' }, - tgs: { icon: 'toolbox', color: 'purple' }, - tweak: { icon: 'wrench', color: 'green' }, - ui: { icon: 'desktop', color: 'blue' }, - mapadd: { icon: 'earth-africa', color: 'yellow' }, - maptweak: { icon: 'map-location-dot', color: 'green' }, - unknown: { icon: 'info-circle', color: 'label' }, +const changeTypes = { + bugfix: { icon: 'bug', color: 'green', desc: 'Fix' }, + fix: { icon: 'bug', color: 'green', desc: 'Fix' }, + wip: { icon: 'hammer', color: 'orange', desc: 'WIP' }, + qol: { icon: 'hand-holding-heart', color: 'green', desc: 'QOL' }, + soundadd: { icon: 'tg-sound-plus', color: 'green', desc: 'Sound add' }, + sounddel: { icon: 'tg-sound-minus', color: 'red', desc: 'Sound del' }, + add: { icon: 'check-circle', color: 'green', desc: 'Addition' }, + expansion: { icon: 'check-circle', color: 'green', desc: 'Addition' }, + rscadd: { icon: 'check-circle', color: 'green', desc: 'Addition' }, + rscdel: { icon: 'times-circle', color: 'red', desc: 'Removal' }, + imageadd: { icon: 'tg-image-plus', color: 'green', desc: 'Sprite add' }, + imagedel: { icon: 'tg-image-minus', color: 'red', desc: 'Sprite del' }, + spellcheck: { icon: 'spell-check', color: 'green', desc: 'Spellcheck' }, + experiment: { icon: 'radiation', color: 'yellow', desc: 'Experiment' }, + balance: { icon: 'balance-scale-right', color: 'yellow', desc: 'Balance' }, + code_imp: { icon: 'code', color: 'green', desc: 'Code improvement' }, + refactor: { icon: 'tools', color: 'green', desc: 'Code refactor' }, + config: { icon: 'cogs', color: 'purple', desc: 'Config' }, + admin: { icon: 'user-shield', color: 'purple', desc: 'Admin' }, + server: { icon: 'server', color: 'purple', desc: 'Server' }, + tgs: { icon: 'toolbox', color: 'purple', desc: 'Server (TGS)' }, + tweak: { icon: 'wrench', color: 'green', desc: 'Tweak' }, + ui: { icon: 'desktop', color: 'blue', desc: 'UI' }, + mapadd: { icon: 'earth-africa', color: 'yellow', desc: 'Map add' }, + maptweak: { icon: 'map-location-dot', color: 'green', desc: 'Map tweak' }, + unknown: { icon: 'info-circle', color: 'label', desc: 'Unknown' }, }; export class Changelog extends Component { @@ -273,29 +273,27 @@ export class Changelog extends Component { {changes.map((change) => { - const changeType = Object.keys(change)[0]; + const changeKey = Object.keys(change)[0]; + const changeType = + changeTypes[changeKey] || changeTypes['unknown']; return ( - + - + + + - {change[changeType]} + {change[changeKey]} ); From 4d43607ef95dc1579e3ed516bfe41285aa4c3dc3 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Tue, 13 Feb 2024 11:38:05 +0000 Subject: [PATCH 2/2] ??? --- tgui/packages/tgui/interfaces/Changelog.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgui/packages/tgui/interfaces/Changelog.jsx b/tgui/packages/tgui/interfaces/Changelog.jsx index 40adabdb733d..91d107673675 100644 --- a/tgui/packages/tgui/interfaces/Changelog.jsx +++ b/tgui/packages/tgui/interfaces/Changelog.jsx @@ -284,7 +284,7 @@ export class Changelog extends Component { 'Changelog__Cell--Icon', ])}>