routes: renaming to remove @ from user routes

This commit is contained in:
@wwwjim 2020-08-06 16:06:54 -07:00
parent d5e41daa4e
commit b23608da18
52 changed files with 188 additions and 109 deletions

View File

@ -4,9 +4,9 @@
### An open source storage system for your files and data that makes it easy to collect, organize, and share them anywhere on the web.
- [Design System](https://slate.host/system)
- [Design System](https://slate.host/_/system)
- [Release Repository](https://github.com/filecoin-project/slate-react-system)
- [Live Application Prototype](https://slate.host/application)
- [Live Application Prototype](https://slate.host/_)
![screenshot](https://user-images.githubusercontent.com/310223/88253285-3a981f80-cc66-11ea-884b-e3b055f6bf46.png)

View File

@ -2,6 +2,27 @@ import * as Strings from "~/common/strings";
const USERNAME_REGEX = new RegExp("^[a-zA-Z0-9_]{0,}[a-zA-Z]+[0-9]*$");
const MIN_PASSWORD_LENGTH = 8;
const REJECT_LIST = [
"_",
"root",
"www",
"website",
"index",
"api",
"public",
"static",
"admin",
"administrator",
"webmaster",
"403",
"404",
"500",
"login",
"sign-in",
"signin",
"log-in",
"logout",
];
export const username = (text) => {
if (Strings.isEmpty(text)) {
@ -12,6 +33,10 @@ export const username = (text) => {
return false;
}
if (REJECT_LIST.includes(text)) {
return false;
}
return true;
};

View File

@ -445,7 +445,7 @@ export default class ApplicationPage extends React.Component {
<WebsitePrototypeWrapper
title="Slate: sign in"
description="Sign in to your Slate account to manage your assets."
url="https://slate.host/application"
url="https://slate.host/_"
>
<SceneSignIn
onAuthenticate={this._handleAuthenticate}
@ -519,7 +519,7 @@ export default class ApplicationPage extends React.Component {
const title = `Slate : ${current.target.pageTitle}`;
const description = "This is an early preview.";
const url = "https://fps.onrender.com/v1";
const url = "https://slate.host/_";
return (
<React.Fragment>

View File

@ -53,10 +53,14 @@ export default (props) => {
return (
<div css={STYLES_CONTAINER} style={props.style}>
<div css={STYLES_LEFT}>
<a css={STYLES_LINK} href="/" style={{ marginRight: 24, fontFamily: Constants.font.codeBold }}>
<a
css={STYLES_LINK}
href="/"
style={{ marginRight: 24, fontFamily: Constants.font.codeBold }}
>
Slate {Constants.values.version}
</a>
<a css={STYLES_LINK} href="/system">
<a css={STYLES_LINK} href="/_/system">
Design System
</a>
</div>

View File

@ -53,7 +53,11 @@ export default (props) => {
return (
<div css={STYLES_CONTAINER} style={props.style}>
<div css={STYLES_LEFT}>
<a css={STYLES_LINK} href={`/@${props.children}`} style={{ fontFamily: Constants.font.codeBold }}>
<a
css={STYLES_LINK}
href={`/${props.children}`}
style={{ fontFamily: Constants.font.codeBold }}
>
{props.children}
</a>
</div>

View File

@ -60,7 +60,7 @@ export default class SidebarCreateSlate extends React.Component {
/>
<System.P style={{ marginTop: 24 }}>
This will create a new slate address at https://slate.host/@
This will create a new slate address at https://slate.host/
{this.props.viewer.username}/{Strings.createSlug(this.state.name)}
</System.P>

View File

@ -187,54 +187,54 @@ export default class SystemPage extends React.Component {
</Head>
<div css={STYLES_BODY}>{children}</div>
<div css={STYLES_SIDEBAR}>
<a css={STYLES_ICON_ELEMENT} href="/system" />
<a css={STYLES_ICON_ELEMENT} href="/_/system" />
<br />
<br />
<span css={STYLES_LABEL}>Experiences</span>
<SidebarLink
url={url}
href="/experiences/create-address"
href="/_/experiences/create-address"
title="CreateFilecoinAddress"
/>
<SidebarLink
url={url}
href="/experiences/make-storage-deal"
href="/_/experiences/make-storage-deal"
title="CreateFilecoinStorageDeal"
/>
<SidebarLink
url={url}
href="/experiences/generate-powergate-token"
href="/_/experiences/generate-powergate-token"
title="CreateToken"
/>
<SidebarLink
url={url}
href="/experiences/filecoin-wallet-balances"
href="/_/experiences/filecoin-wallet-balances"
title="FilecoinBalancesList"
/>
<SidebarLink
url={url}
href="/experiences/list-filecoin-deals"
href="/_/experiences/list-filecoin-deals"
title="FilecoinDealsList"
/>
<SidebarLink
url={url}
href="/experiences/filecoin-settings"
href="/_/experiences/filecoin-settings"
title="FilecoinSettings"
/>
<SidebarLink
url={url}
href="/experiences/friends-list"
href="/_/experiences/friends-list"
title="FriendsList"
/>
<SidebarLink
url={url}
href="/experiences/peers-list"
href="/_/experiences/peers-list"
title="PeersList"
/>
<SidebarLink
url={url}
href="/experiences/send-address-filecoin"
href="/_/experiences/send-address-filecoin"
title="SendAddressFilecoin"
/>
@ -243,39 +243,51 @@ export default class SystemPage extends React.Component {
<br />
Components
</span>
<SidebarLink url={url} href="/system/buttons" title="Buttons" />
<SidebarLink url={url} href="/system/card-tabs" title="Card Tabs" />
<SidebarLink url={url} href="/system/carousel" title="Carousel" />
<SidebarLink url={url} href="/system/checkboxes" title="Checkboxes" />
<SidebarLink url={url} href="/system/colors" title="Colors" />
<SidebarLink url={url} href="/system/datepicker" title="Datepicker" />
<SidebarLink url={url} href="/system/dropdowns" title="Dropdowns" />
<SidebarLink url={url} href="/system/globe" title="Globe" />
<SidebarLink url={url} href="/system/icons" title="Icons" />
<SidebarLink url={url} href="/system/inputs" title="Inputs" />
<SidebarLink url={url} href="/_/system/buttons" title="Buttons" />
<SidebarLink url={url} href="/_/system/card-tabs" title="Card Tabs" />
<SidebarLink url={url} href="/_/system/carousel" title="Carousel" />
<SidebarLink
url={url}
href="/system/list-editor"
href="/_/system/checkboxes"
title="Checkboxes"
/>
<SidebarLink url={url} href="/_/system/colors" title="Colors" />
<SidebarLink
url={url}
href="/_/system/datepicker"
title="Datepicker"
/>
<SidebarLink url={url} href="/_/system/dropdowns" title="Dropdowns" />
<SidebarLink url={url} href="/_/system/globe" title="Globe" />
<SidebarLink url={url} href="/_/system/icons" title="Icons" />
<SidebarLink url={url} href="/_/system/inputs" title="Inputs" />
<SidebarLink
url={url}
href="/_/system/list-editor"
title="List Editor"
/>
<SidebarLink url={url} href="/system/loaders" title="Loaders" />
<SidebarLink url={url} href="/system/modals" title="Modals" />
<SidebarLink url={url} href="/_/system/loaders" title="Loaders" />
<SidebarLink url={url} href="/_/system/modals" title="Modals" />
<SidebarLink
url={url}
href="/system/notifications"
href="/_/system/notifications"
title="Notifications"
/>
<SidebarLink url={url} href="/system/radios" title="Radios" />
<SidebarLink url={url} href="/system/sliders" title="Sliders" />
<SidebarLink url={url} href="/system/stats" title="Stats" />
<SidebarLink url={url} href="/system/tables" title="Tables" />
<SidebarLink url={url} href="/system/tabs" title="Tabs" />
<SidebarLink url={url} href="/system/toggles" title="Toggles" />
<SidebarLink url={url} href="/system/tooltips" title="Tooltips" />
<SidebarLink url={url} href="/system/typography" title="Typography" />
<SidebarLink url={url} href="/_/system/radios" title="Radios" />
<SidebarLink url={url} href="/_/system/sliders" title="Sliders" />
<SidebarLink url={url} href="/_/system/stats" title="Stats" />
<SidebarLink url={url} href="/_/system/tables" title="Tables" />
<SidebarLink url={url} href="/_/system/tabs" title="Tabs" />
<SidebarLink url={url} href="/_/system/toggles" title="Toggles" />
<SidebarLink url={url} href="/_/system/tooltips" title="Tooltips" />
<SidebarLink
url={url}
href="/system/avatar-group"
href="/_/system/typography"
title="Typography"
/>
<SidebarLink
url={url}
href="/_/system/avatar-group"
title="Avatar Group"
/>

View File

@ -45,7 +45,7 @@ function createWindow() {
// and load the index.html of the app.
// TODO(jim):
// We shouldn't hardcode this port.
mainWindow.loadURL("http://localhost:1337/application");
mainWindow.loadURL("http://localhost:1337/_");
console.log("window created");
}
@ -57,7 +57,7 @@ app.whenReady().then(() => {
bootServer();
createWindow();
app.on("activate", function () {
app.on("activate", function() {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow();
@ -67,7 +67,7 @@ app.whenReady().then(() => {
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on("window-all-closed", function () {
app.on("window-all-closed", function() {
if (process.platform !== "darwin") app.quit();
});

View File

@ -40,7 +40,7 @@ export default class SystemPageCreateAddress extends React.Component {
<SystemPage
title="SDS: Create Address"
description="..."
url="https://slate.host/experiences/create-address"
url="https://slate.host/_/experiences/create-address"
>
<System.H1>
Create a Filecoin Address{" "}

View File

@ -86,7 +86,7 @@ export default class SystemPageFilecoinSettings extends React.Component {
<SystemPage
title="SDS: Filecoin Settings"
description="..."
url="https://slate.host/experiences/filecoin-settings"
url="https://slate.host/_/experiences/filecoin-settings"
>
<System.H1>
Filecoin Settings{" "}

View File

@ -52,7 +52,7 @@ export default class SystemPageFilecoinWalletBalances extends React.Component {
<SystemPage
title="SDS: Filecoin Wallet Balances"
description="..."
url="https://slate.host/experiences/filecoin-wallet-balances"
url="https://slate.host/_/experiences/filecoin-wallet-balances"
>
<System.H1>
Filecoin Wallet Balances{" "}

View File

@ -169,7 +169,7 @@ export default class SystemPagePeersList extends React.Component {
<SystemPage
title="SDS: Friends List"
description="..."
url="https://slate.host/experiences/friends-list"
url="https://slate.host/_/experiences/friends-list"
>
<System.H1>
Friends List <ViewSourceLink file="experiences/friends-list.js" />

View File

@ -57,7 +57,7 @@ export default class GeneratePowergateToken extends React.Component {
<SystemPage
title="SDS: Generate Powergate Token"
description="..."
url="https://slate.host/experiences/generate-powergate-token"
url="https://slate.host/_/experiences/generate-powergate-token"
>
<System.H1>
Generate Powergate token{" "}

View File

@ -152,7 +152,7 @@ export default class SystemPageDeals extends React.Component {
<SystemPage
title="SDS: Filecoin Deals"
description="..."
url="https://slate.host/experiences/list-filecoin-deals"
url="https://slate.host/_/experiences/list-filecoin-deals"
>
<System.H1>
View Storage and Retrieval Deals{" "}

View File

@ -66,7 +66,7 @@ export default class SystemPageMakeStorageDeal extends React.Component {
<SystemPage
title="SDS: Make a Storage Deal"
description="..."
url="https://slate.host/experiences/make-storage-deal"
url="https://slate.host/_/experiences/make-storage-deal"
>
<System.H1>
Make a Storage Deal{" "}

View File

@ -39,7 +39,7 @@ export default class SystemPagePeersList extends React.Component {
<SystemPage
title="SDS: Peers List"
description="..."
url="https://slate.host/experiences/peers-list"
url="https://slate.host/_/experiences/peers-list"
>
<System.H1>
Peers List <ViewSourceLink file="experiences/peers-list.js" />

View File

@ -39,7 +39,7 @@ export default class SystemPageSendAddressFilecoin extends React.Component {
<SystemPage
title="SDS: Send Address Filecoin"
description="..."
url="https://slate.host/experiences/send-address-filecoin"
url="https://slate.host/_/experiences/send-address-filecoin"
>
<System.H1>
Send an Address Filecoin{" "}

View File

@ -79,9 +79,7 @@ const STYLES_LINK = css`
export default class ProfilePage extends React.Component {
render() {
const title = this.props.creator
? `@${this.props.creator.username}`
: "404";
const title = this.props.creator ? `${this.props.creator.username}` : "404";
const url = `https://slate.host/${title}`;
const description = "A user on Slate.";
@ -100,7 +98,7 @@ export default class ProfilePage extends React.Component {
{this.props.creator.slates && this.props.creator.slates.length ? (
<p css={STYLES_CARD_PARAGRAPH}>
{this.props.creator.slates.map((row) => {
const url = `/@${this.props.creator.username}/${
const url = `/${this.props.creator.username}/${
row.slatename
}`;

View File

@ -63,9 +63,7 @@ export default class SlatePage extends React.Component {
});
render() {
const title = `@${this.props.slate.ownername}/${
this.props.slate.slatename
}`;
const title = `${this.props.slate.ownername}/${this.props.slate.slatename}`;
const url = `https://slate.host/${title}`;
const description = "A slate.";

View File

@ -22,7 +22,7 @@ export default class SystemAvatarGroup extends React.Component {
<SystemPage
title="SDS: Avatar Group"
description="..."
url="https://slate.host/system/avatar-group"
url="https://slate.host/_/system/avatar-group"
>
<System.H1>
Avatar Group <ViewSourceLink file="system/avatar-group.js" />

View File

@ -11,7 +11,7 @@ export default class SystemPageButtons extends React.Component {
<SystemPage
title="SDS: Buttons"
description="..."
url="https://slate.host/system/buttons"
url="https://slate.host/_/system/buttons"
>
<System.H1>
Buttons <ViewSourceLink file="system/buttons.js" />

View File

@ -34,7 +34,7 @@ export default class SystemPageCardTabs extends React.Component {
<SystemPage
title="SDS: Card Tabs"
description="..."
url="https://slate.host/system/card-tabs"
url="https://slate.host/_/system/card-tabs"
>
<System.H1>
Card Tabs <ViewSourceLink file="system/card-tabs.js" />

View File

@ -41,7 +41,7 @@ export default class SystemPageCarousel extends React.Component {
<SystemPage
title="SDS: Carousel"
description="..."
url="https://slate.host/system/carousel"
url="https://slate.host/_/system/carousel"
>
<System.H1>
Carousel <ViewSourceLink file="system/carousel.js" />

View File

@ -22,7 +22,7 @@ export default class SystemPageCheckboxes extends React.Component {
<SystemPage
title="SDS: Checkboxes"
description="..."
url="https://slate.host/system/checkboxes"
url="https://slate.host/_/system/checkboxes"
>
<System.H1>
Checkboxes <ViewSourceLink file="system/checkboxes.js" />

View File

@ -33,7 +33,7 @@ export default class SystemPageColors extends React.Component {
<SystemPage
title="SDS: Colors"
description="..."
url="https://slate.host/system/colors"
url="https://slate.host/_/system/colors"
>
<System.H1>
Colors <ViewSourceLink file="system/colors.js" />

View File

@ -29,7 +29,7 @@ export default class SystemPageDatepicker extends React.Component {
<SystemPage
title="SDS: Datepicker"
description="..."
url="https://slate.host/system/datepicker"
url="https://slate.host/_/system/datepicker"
>
<System.H1>
Datepicker <ViewSourceLink file="system/datepicker.js" />

View File

@ -38,7 +38,7 @@ export default class SystemPageDropdowns extends React.Component {
<SystemPage
title="SDS: Dropdowns"
description="..."
url="https://slate.host/system/dropdowns"
url="https://slate.host/_/system/dropdowns"
>
<System.H1>
Dropdowns <ViewSourceLink file="system/dropdowns.js" />

View File

@ -12,7 +12,7 @@ export default class SystemPageGlobe extends React.Component {
<SystemPage
title="SDS: Globe"
description="..."
url="https://slate.host/system/globe"
url="https://slate.host/_/system/globe"
>
<System.H1>
Globe <ViewSourceLink file="system/globe.js" />

View File

@ -56,7 +56,7 @@ export default class SystemPageIcons extends React.Component {
<SystemPage
title="SDS: Icons"
description="..."
url="https://slate.host/system/icons"
url="https://slate.host/_/system/icons"
>
<System.H1>
Icons <ViewSourceLink file="system/icons.js" />

View File

@ -11,7 +11,7 @@ export default class SystemPageRoot extends React.Component {
<SystemPage
title={`Slate Design System ${Constants.values.sds}`}
description="We built a design system you can use while we are building Slate, a Filecoin client."
url="https://slate.host/system"
url="https://slate.host/_/system"
>
<img
src="/public/static/social-github-dark.jpg"

View File

@ -26,7 +26,7 @@ export default class SystemPageInputs extends React.Component {
<SystemPage
title="SDS: Inputs"
description="..."
url="https://slate.host/system/inputs"
url="https://slate.host/_/system/inputs"
>
<System.H1>
Inputs <ViewSourceLink file="system/inputs.js" />

View File

@ -29,7 +29,7 @@ export default class SystemPageListEditor extends React.Component {
<SystemPage
title="SDS: List Editor"
description="..."
url="https://slate.host/system/list-editor"
url="https://slate.host/_/system/list-editor"
>
<System.H1>
List Editor <ViewSourceLink file="system/listeditor.js" />

View File

@ -12,7 +12,7 @@ export default class SystemLoaders extends React.Component {
<SystemPage
title="SDS: Loaders"
description="..."
url="https://slate.host/system/loaders"
url="https://slate.host/_/system/loaders"
>
<System.H1>
Loaders <ViewSourceLink file="system/loaders.js" />

View File

@ -21,7 +21,7 @@ export default class SystemPageNotifications extends React.Component {
<SystemPage
title="SDS: Modals"
description="..."
url="https://slate.host/system/modals"
url="https://slate.host/_/system/modals"
>
<System.H1>
Modals <ViewSourceLink file="system/modals.js" />

View File

@ -26,7 +26,7 @@ export default class SystemPageNotifications extends React.Component {
<SystemPage
title="SDS: Notifications"
description="..."
url="https://slate.host/system/notifications"
url="https://slate.host/_/system/notifications"
>
<System.H1>
Notifications <ViewSourceLink file="system/notification.js" />

View File

@ -51,7 +51,7 @@ export default class SystemPageRadios extends React.Component {
<SystemPage
title="SDS: Radios"
description="..."
url="https://slate.host/system/radios"
url="https://slate.host/_/system/radios"
>
<System.H1>
Radios <ViewSourceLink file="system/radios.js" />

View File

@ -24,7 +24,7 @@ export default class SystemPageSliders extends React.Component {
<SystemPage
title="SDS: Sliders"
description="..."
url="https://slate.host/system/sliders"
url="https://slate.host/_/system/sliders"
>
<System.H1>
Sliders <ViewSourceLink file="system/sliders.js" />

View File

@ -11,7 +11,7 @@ export default class SystemPageStats extends React.Component {
<SystemPage
title="SDS: Stats"
description="..."
url="https://slate.host/system/stats"
url="https://slate.host/_/system/stats"
>
<System.H1>
Stats <ViewSourceLink file="system/stats.js" />

View File

@ -21,7 +21,7 @@ export default class SystemPageTables extends React.Component {
<SystemPage
title="SDS: Tables"
description="..."
url="https://slate.host/system/tables"
url="https://slate.host/_/system/tables"
>
<System.H1>
Tables <ViewSourceLink file="system/tables.js" />

View File

@ -42,7 +42,7 @@ export default class SystemPageTabs extends React.Component {
<SystemPage
title="SDS: Tabs"
description="..."
url="https://slate.host/system/tabs"
url="https://slate.host/_/system/tabs"
>
<System.H1>
Tabs <ViewSourceLink file="system/tabs.js" />

View File

@ -22,7 +22,7 @@ export default class SystemPageToggles extends React.Component {
<SystemPage
title="SDS: Toggles"
description="..."
url="https://slate.host/system/toggles"
url="https://slate.host/_/system/toggles"
>
<System.H1>
Toggles <ViewSourceLink file="system/toggles.js" />

View File

@ -12,7 +12,7 @@ export default class SystemPageTooltips extends React.Component {
<SystemPage
title="SDS: Tooltips"
description="..."
url="https://slate.host/system/tooltips"
url="https://slate.host/_/system/tooltips"
>
<System.H1>
Tooltips <ViewSourceLink file="system/tooltips.js" />

View File

@ -153,9 +153,7 @@ export default class IndexPage extends React.Component {
{Constants.values.version} for Filecoin
</div>
<div css={STYLES_CARD_ACTIONS_RIGHT}>
<System.ButtonPrimary
onClick={() => window.open("/application")}
>
<System.ButtonPrimary onClick={() => window.open("/_")}>
Use Slate
</System.ButtonPrimary>
</div>

View File

@ -136,7 +136,7 @@ export default class SceneEditAccount extends React.Component {
};
render() {
const profileURL = `https://slate.host/@${this.state.username}`;
const profileURL = `https://slate.host/${this.state.username}`;
return (
<ScenePage>
@ -148,15 +148,25 @@ export default class SceneEditAccount extends React.Component {
description="This image will appear in various lists."
/>
<Avatar style={{ marginTop: 24 }} size={256} url={this.props.viewer.data.photo} />
<Avatar
style={{ marginTop: 24 }}
size={256}
url={this.props.viewer.data.photo}
/>
<div style={{ marginTop: 24 }}>
<input css={STYLES_FILE_HIDDEN} type="file" id="file" onChange={this._handleUpload} />
<input
css={STYLES_FILE_HIDDEN}
type="file"
id="file"
onChange={this._handleUpload}
/>
<System.ButtonPrimary
style={{ margin: "0 16px 16px 0" }}
type="label"
htmlFor="file"
loading={this.state.changingAvatar}>
loading={this.state.changingAvatar}
>
Pick avatar
</System.ButtonPrimary>
</div>
@ -166,7 +176,8 @@ export default class SceneEditAccount extends React.Component {
label="Username"
description={
<React.Fragment>
This is your username on Slate. Your username is used for your profile URL{" "}
This is your username on Slate. Your username is used for your
profile URL{" "}
<a href={profileURL} target="_blank">
{profileURL}
</a>
@ -179,7 +190,10 @@ export default class SceneEditAccount extends React.Component {
/>
<div style={{ marginTop: 24 }}>
<System.ButtonPrimary onClick={this._handleSave} loading={this.state.changingUsername}>
<System.ButtonPrimary
onClick={this._handleSave}
loading={this.state.changingUsername}
>
Change username
</System.ButtonPrimary>
</div>
@ -211,7 +225,10 @@ export default class SceneEditAccount extends React.Component {
/>
<div style={{ marginTop: 24 }}>
<System.ButtonPrimary onClick={this._handleChangePassword} loading={this.state.changingPassword}>
<System.ButtonPrimary
onClick={this._handleChangePassword}
loading={this.state.changingPassword}
>
Change password
</System.ButtonPrimary>
</div>
@ -223,7 +240,10 @@ export default class SceneEditAccount extends React.Component {
/>
<div style={{ marginTop: 24 }}>
<System.ButtonPrimary onClick={this._handleDelete} loading={this.state.deleting}>
<System.ButtonPrimary
onClick={this._handleDelete}
loading={this.state.deleting}
>
Delete my account
</System.ButtonPrimary>
</div>

View File

@ -71,14 +71,16 @@ export default class SceneHome extends React.Component {
rows: this.props.viewer.slates.map((each) => {
return {
...each,
url: `/@${this.props.viewer.username}/${each.slatename}`,
url: `/${this.props.viewer.username}/${each.slatename}`,
public: each.data.public,
};
}),
};
// TODO(jim): Refactor later.
const slateButtons = [{ name: "Create slate", type: "SIDEBAR", value: "SIDEBAR_CREATE_SLATE" }];
const slateButtons = [
{ name: "Create slate", type: "SIDEBAR", value: "SIDEBAR_CREATE_SLATE" },
];
// TODO(jim): Refactor later.
const data = {
@ -154,7 +156,11 @@ export default class SceneHome extends React.Component {
/>
<System.H1 style={{ marginTop: 48 }}>Home</System.H1>
{this.props.viewer.addresses[0] ? (
<Section title="Wallet addresses" buttons={walletButtons} onAction={this.props.onAction}>
<Section
title="Wallet addresses"
buttons={walletButtons}
onAction={this.props.onAction}
>
<System.Table
data={wallet}
name="transaction"
@ -164,7 +170,11 @@ export default class SceneHome extends React.Component {
</Section>
) : null}
<Section title="Slates" buttons={slateButtons} onAction={this.props.onAction}>
<Section
title="Slates"
buttons={slateButtons}
onAction={this.props.onAction}
>
<System.Table
data={slates}
name="slate"
@ -174,7 +184,11 @@ export default class SceneHome extends React.Component {
</Section>
{this.props.viewer.library[0] ? (
<Section title="Recent data" buttons={dataButtons} onAction={this.props.onAction}>
<Section
title="Recent data"
buttons={dataButtons}
onAction={this.props.onAction}
>
<System.Table
data={data}
name="data"

View File

@ -83,7 +83,7 @@ export default class SceneSlate extends React.Component {
render() {
const { data } = this.props.current;
const { slatename } = this.state;
const url = `/@${this.props.viewer.username}/${slatename}`;
const url = `/${this.props.viewer.username}/${slatename}`;
const slates = {
columns: [

View File

@ -30,14 +30,16 @@ export default class SceneSlates extends React.Component {
rows: this.props.viewer.slates.map((each) => {
return {
...each,
url: `/@${this.props.viewer.username}/${each.slatename}`,
url: `/${this.props.viewer.username}/${each.slatename}`,
public: each.data.public,
};
}),
};
// TODO(jim): Refactor later.
const slateButtons = [{ name: "Create slate", type: "SIDEBAR", value: "SIDEBAR_CREATE_SLATE" }];
const slateButtons = [
{ name: "Create slate", type: "SIDEBAR", value: "SIDEBAR_CREATE_SLATE" },
];
return (
<ScenePage>
@ -46,7 +48,11 @@ export default class SceneSlates extends React.Component {
description="No! Consider this page just a functionality test. Slates will be collaborative mood boards and will have a much more intuitive experience than this."
/>
<System.H1 style={{ marginTop: 48 }}>Slates</System.H1>
<Section title="Slates" buttons={slateButtons} onAction={this.props.onAction}>
<Section
title="Slates"
buttons={slateButtons}
onAction={this.props.onAction}
>
<System.Table
data={slates}
name="slate"

View File

@ -27,7 +27,7 @@ app.prepare().then(async () => {
server.use("/public", express.static("public"));
server.get("/application", async (req, res) => {
server.get("/_", async (req, res) => {
const id = Utilities.getIdFromCookie(req);
let viewer = null;
@ -37,12 +37,12 @@ app.prepare().then(async () => {
});
}
return app.render(req, res, "/application", {
return app.render(req, res, "/_", {
viewer,
});
});
server.get("/@:username", async (req, res) => {
server.get("/:username", async (req, res) => {
const id = Utilities.getIdFromCookie(req);
let viewer = null;
@ -69,7 +69,7 @@ app.prepare().then(async () => {
publicOnly: true,
});
return app.render(req, res, "/profile", {
return app.render(req, res, "/_/profile", {
viewer,
creator: {
username: creator.username,
@ -79,7 +79,7 @@ app.prepare().then(async () => {
});
});
server.get("/@:username/:slatename", async (req, res) => {
server.get("/:username/:slatename", async (req, res) => {
const slate = await Data.getSlateByName({
slatename: req.params.slatename,
});
@ -106,7 +106,7 @@ app.prepare().then(async () => {
return res.redirect("/403");
}
return app.render(req, res, "/slate", {
return app.render(req, res, "/_/slate", {
slate: JSON.parse(
JSON.stringify({ ...slate, ownername: req.params.username })
),