mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 05:09:17 +00:00
Merge remote-tracking branch 'origin/unstable' into unstable
This commit is contained in:
commit
1f27f83616
@ -1,3 +1,30 @@
|
||||
.CommandsPage {
|
||||
margin: 10px;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
background-color: var(--background-color);
|
||||
flex-direction: column;
|
||||
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.CommandsPage_Title {
|
||||
max-width: 275px;
|
||||
max-height: 60px;
|
||||
|
||||
font-size: 48px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.CommandsPage_List {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
gap: 15px;
|
||||
margin-bottom: 28px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
44
src/handbook/src/css/widgets/Card.scss
Normal file
44
src/handbook/src/css/widgets/Card.scss
Normal file
@ -0,0 +1,44 @@
|
||||
.Card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
width: 100%;
|
||||
max-width: 1510px;
|
||||
max-height: 100px;
|
||||
|
||||
gap: 10px;
|
||||
border-radius: 15px;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
|
||||
background-color: var(--secondary-color);
|
||||
}
|
||||
|
||||
.Card_Header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 40%;
|
||||
|
||||
gap: 15px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.Card_Title {
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.Card_Alternate {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.Card_Description {
|
||||
color: var(--text-primary-color);
|
||||
|
||||
overflow-y: hidden;
|
||||
max-height: 100%;
|
||||
}
|
@ -4,11 +4,10 @@ import SideBar from "@views/SideBar";
|
||||
import Content from "@views/Content";
|
||||
|
||||
import type { Page } from "@backend/types";
|
||||
import { isPage } from "@backend/types";
|
||||
|
||||
import "@css/App.scss";
|
||||
import "@css/Text.scss";
|
||||
import { isPage } from "@backend/types";
|
||||
|
||||
|
||||
// Based on the design at: https://www.figma.com/file/PDeAVDkTDF5vvUGGdaIZ39/GM-Handbook.
|
||||
// Currently designed by: Magix.
|
||||
|
@ -1,16 +1,30 @@
|
||||
import React from "react";
|
||||
|
||||
import Card from "@components/widgets/Card";
|
||||
|
||||
import { listCommands } from "@backend/data";
|
||||
|
||||
import "@css/pages/CommandsPage.scss";
|
||||
|
||||
class CommandsPage extends React.Component<any, any> {
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
class CommandsPage extends React.PureComponent {
|
||||
render() {
|
||||
return (
|
||||
<div className={"CommandsPage"}>
|
||||
<h1>Commands</h1>
|
||||
<h1 className={"CommandsPage_Title"}>Commands</h1>
|
||||
|
||||
<div className={"CommandsPage_List"}>
|
||||
{
|
||||
listCommands().map(command => (
|
||||
<Card
|
||||
title={command.name[0]}
|
||||
alternate={command.name.length == 1 ? undefined :
|
||||
`(aka /${command.name.slice(1).join(", /")})`}
|
||||
description={command.description}
|
||||
height={75}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
|
||||
import HomeButton from "@app/ui/widgets/HomeButton";
|
||||
import HomeButton from "@components/widgets/HomeButton";
|
||||
|
||||
import { ReactComponent as DiscordLogo } from "@icons/discord.svg";
|
||||
|
||||
|
52
src/handbook/src/ui/widgets/Card.tsx
Normal file
52
src/handbook/src/ui/widgets/Card.tsx
Normal file
@ -0,0 +1,52 @@
|
||||
import React from "react";
|
||||
|
||||
import "@css/widgets/Card.scss";
|
||||
|
||||
interface IProps {
|
||||
title: string;
|
||||
alternate?: string;
|
||||
description?: string | string[];
|
||||
|
||||
height?: number | string;
|
||||
|
||||
onClick?: () => void;
|
||||
onOver?: () => void;
|
||||
onOut?: () => void;
|
||||
}
|
||||
|
||||
class Card extends React.PureComponent<IProps> {
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
className={"Card"}
|
||||
onClick={this.props.onClick}
|
||||
onMouseOver={this.props.onOver}
|
||||
onMouseOut={this.props.onOut}
|
||||
style={{ height: this.props.height }}
|
||||
>
|
||||
<div className={"Card_Header"}>
|
||||
<p className={"Card_Title"}>{this.props.title}</p>
|
||||
{this.props.alternate &&
|
||||
<p className={"Card_Alternate"}>{this.props.alternate}</p>}
|
||||
</div>
|
||||
|
||||
<div style={{ height: "50%", alignItems: "center" }}>
|
||||
{
|
||||
this.props.description ? (
|
||||
Array.isArray(this.props.description) ?
|
||||
this.props.description.map((line, index) => (
|
||||
<p className={"Card_Description"} key={index}>{line}</p>
|
||||
)) : <p className={"Card_Description"}>{this.props.description}</p>
|
||||
) : undefined
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Card;
|
@ -1,19 +0,0 @@
|
||||
import React from "react";
|
||||
|
||||
interface IProps {
|
||||
|
||||
}
|
||||
|
||||
class Command extends React.PureComponent<IProps> {
|
||||
constructor(props: IProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<a>command</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user