mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
feat(design-system): use rpcs
This commit is contained in:
parent
f31b32c54a
commit
00dff464df
7 changed files with 14 additions and 10 deletions
|
@ -5,6 +5,8 @@ package(default_visibility = ["//visibility:public"])
|
||||||
react_library(
|
react_library(
|
||||||
name = "fixtures",
|
name = "fixtures",
|
||||||
deps = [
|
deps = [
|
||||||
"@roleypoly/rpc",
|
"//src/rpc/discord",
|
||||||
|
"//src/rpc/platform",
|
||||||
|
"//src/rpc/shared",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Role } from '@roleypoly/rpc/shared';
|
import { Role } from 'roleypoly/src/rpc/shared';
|
||||||
|
|
||||||
export const demoData: Role.AsObject[] = [
|
export const demoData: Role.AsObject[] = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import { Member } from '@roleypoly/rpc/discord';
|
import { Member } from 'roleypoly/src/rpc/discord';
|
||||||
import { Category, GuildData, GuildEnumeration } from '@roleypoly/rpc/platform';
|
import { Category, GuildData, GuildEnumeration } from 'roleypoly/src/rpc/platform';
|
||||||
import {
|
import {
|
||||||
DiscordUser,
|
DiscordUser,
|
||||||
Guild,
|
Guild,
|
||||||
GuildRoles,
|
GuildRoles,
|
||||||
Role,
|
Role,
|
||||||
RoleypolyUser,
|
RoleypolyUser,
|
||||||
} from '@roleypoly/rpc/shared';
|
} from 'roleypoly/src/rpc/shared';
|
||||||
|
|
||||||
export const roleCategory: Role.AsObject[] = [
|
export const roleCategory: Role.AsObject[] = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,9 @@ def _render_deps(deps = []):
|
||||||
output_deps = []
|
output_deps = []
|
||||||
|
|
||||||
for dep in deps:
|
for dep in deps:
|
||||||
if dep.startswith("//"):
|
if dep.startswith("//src/rpc"):
|
||||||
|
output_deps.append(dep + ":ts")
|
||||||
|
elif dep.startswith("//"):
|
||||||
output_deps.append(dep)
|
output_deps.append(dep)
|
||||||
else:
|
else:
|
||||||
output_deps.append("@npm//" + dep)
|
output_deps.append("@npm//" + dep)
|
||||||
|
|
|
@ -11,7 +11,7 @@ react_library(
|
||||||
"styled-components",
|
"styled-components",
|
||||||
"//src/design-system/atoms/colors",
|
"//src/design-system/atoms/colors",
|
||||||
"//src/design-system/atoms/timings",
|
"//src/design-system/atoms/timings",
|
||||||
"@roleypoly/rpc",
|
"//src/rpc/shared",
|
||||||
"@types/chroma-js",
|
"@types/chroma-js",
|
||||||
"@types/react",
|
"@types/react",
|
||||||
"@types/styled-components",
|
"@types/styled-components",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Role as RPCRole } from '@roleypoly/rpc/shared';
|
import { Role as RPCRole } from 'roleypoly/src/rpc/shared';
|
||||||
import * as styled from './Role.styled';
|
import * as styled from './Role.styled';
|
||||||
import { FaCheck, FaTimes } from 'react-icons/fa';
|
import { FaCheck, FaTimes } from 'react-icons/fa';
|
||||||
import { numberToChroma } from 'roleypoly/src/design-system/atoms/colors';
|
import { numberToChroma } from 'roleypoly/src/design-system/atoms/colors';
|
||||||
|
|
|
@ -14,11 +14,11 @@ type TabProps = {
|
||||||
export const TabView = (props: TabViewProps) => {
|
export const TabView = (props: TabViewProps) => {
|
||||||
const tabNames = React.Children.map(props.children, (child) => {
|
const tabNames = React.Children.map(props.children, (child) => {
|
||||||
if (!React.isValidElement(child)) {
|
if (!React.isValidElement(child)) {
|
||||||
return null;
|
return '(Oops)';
|
||||||
}
|
}
|
||||||
|
|
||||||
return child.props.title;
|
return child.props.title;
|
||||||
});
|
}) as string[];
|
||||||
|
|
||||||
if (tabNames.length === 0) {
|
if (tabNames.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue