-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Removes grid usage + heavy refactors (#1940)
* Removes grid usage + heavy refactors (#82571) ## About The Pull Request Grid has been deprecated for quite some time and we still use it. I won't completely remove the component, this way downstreams won't immediately suffer, but I can remove it from usage. Some of these UIs had issues with them and as a hobby project I've refactored them into typescript / rebuilt them. Airlock electronics, for instance, looks substantially better. <details> <summary>before/after as requested</summary> current airlock electronics scrolls into oblivion ![6RJ29HCPob](https://github.com/tgstation/tgstation/assets/42397676/ba82bc20-40fa-4af0-b709-7c8846c25652) updated ![Screenshot 2024-04-11 164321](https://github.com/tgstation/tgstation/assets/42397676/05507e06-6305-4175-8476-778c345f02c8) </details> ## Why It's Good For The Game Code improvement + probably UI bug fixes ## Changelog :cl: fix: Airlock electronics and other access-config type UIs should look much better. /:cl: * Removes grid usage + heavy refactors * Updates our UIs to get rid of grid usage --------- Co-authored-by: Jeremiah <[email protected]> Co-authored-by: Mal <[email protected]>
- Loading branch information
1 parent
d8de46f
commit 29f5312
Showing
25 changed files
with
1,463 additions
and
1,251 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @file | ||
* @copyright 2020 Aleksej Komarov | ||
* @license MIT | ||
*/ | ||
|
||
import { PropsWithChildren } from 'react'; | ||
|
||
import { logger } from '../logging'; | ||
import { BoxProps } from './Box'; | ||
import { Table } from './Table'; | ||
|
||
/** @deprecated Do not use. Use stack instead. */ | ||
export function Grid(props: PropsWithChildren<BoxProps>) { | ||
const { children, ...rest } = props; | ||
logger.error('Grid component is deprecated. Use a Stack instead.'); | ||
return ( | ||
<Table {...rest}> | ||
<Table.Row>{children}</Table.Row> | ||
</Table> | ||
); | ||
} | ||
|
||
type Props = Partial<{ | ||
/** Width of the column in percentage. */ | ||
size: number; | ||
}> & | ||
BoxProps; | ||
|
||
/** @deprecated Do not use. Use stack instead. */ | ||
export function GridColumn(props: Props) { | ||
const { size = 1, style, ...rest } = props; | ||
return ( | ||
<Table.Cell | ||
style={{ | ||
width: size + '%', | ||
...style, | ||
}} | ||
{...rest} | ||
/> | ||
); | ||
} | ||
|
||
Grid.Column = GridColumn; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.