mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-28 05:52:49 +03:00
Merge pull request #205 from filecoin-project/@martinalong/misc-style-improvements
@martinalong/misc style improvements
This commit is contained in:
commit
903d46f330
@ -59,7 +59,7 @@ const UserEntry = ({ item }) => {
|
|||||||
style={{ backgroundImage: `url(${item.data.photo})` }}
|
style={{ backgroundImage: `url(${item.data.photo})` }}
|
||||||
css={STYLES_PROFILE_IMAGE}
|
css={STYLES_PROFILE_IMAGE}
|
||||||
/>
|
/>
|
||||||
{item.data.name ? <strong>{item.data.name}</strong> : null}
|
{item.data.name ? <div>{item.data.name}</div> : null}
|
||||||
<div>@{item.username}</div>
|
<div>@{item.username}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import React, { Component } from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import * as Constants from "~/common/constants";
|
import * as Constants from "~/common/constants";
|
||||||
import * as SVG from "~/common/svg";
|
import * as SVG from "~/common/svg";
|
||||||
|
|
||||||
import { css } from "@emotion/react";
|
import { css } from "@emotion/react";
|
||||||
|
import { ProcessedText } from "~/components/system/components/Typography";
|
||||||
|
|
||||||
import SlateMediaObjectPreview from "~/components/core/SlateMediaObjectPreview";
|
import SlateMediaObjectPreview from "~/components/core/SlateMediaObjectPreview";
|
||||||
|
|
||||||
const STYLES_IMAGE_ROW = css`
|
const STYLES_IMAGE_ROW = css`
|
||||||
@ -139,6 +140,7 @@ const STYLES_BODY = css`
|
|||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
white-space: pre-wrap;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const STYLES_CREATE_NEW = css`
|
const STYLES_CREATE_NEW = css`
|
||||||
@ -152,7 +154,7 @@ const STYLES_CREATE_NEW = css`
|
|||||||
height: 160px;
|
height: 160px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default class SlatePreviewBlock extends Component {
|
export default class SlatePreviewBlock extends React.Component {
|
||||||
_ref;
|
_ref;
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -175,14 +177,14 @@ export default class SlatePreviewBlock extends Component {
|
|||||||
return (
|
return (
|
||||||
<div css={STYLES_BLOCK}>
|
<div css={STYLES_BLOCK}>
|
||||||
<div css={STYLES_TITLE_LINE}>
|
<div css={STYLES_TITLE_LINE}>
|
||||||
<strong
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: Constants.typescale.lvl2,
|
fontSize: Constants.typescale.lvl2,
|
||||||
fontFamily: Constants.font.semiBold,
|
fontFamily: Constants.font.semiBold,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.props.slate.data.name}
|
{this.props.slate.data.name}
|
||||||
</strong>
|
</div>
|
||||||
{this.props.editing ? (
|
{this.props.editing ? (
|
||||||
this.props.slate.data.public ? (
|
this.props.slate.data.public ? (
|
||||||
<div
|
<div
|
||||||
@ -195,7 +197,13 @@ export default class SlatePreviewBlock extends Component {
|
|||||||
Public
|
Public
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div css={STYLES_TAG} style={{ opacity: "25%" }}>
|
<div
|
||||||
|
css={STYLES_TAG}
|
||||||
|
style={{
|
||||||
|
color: "rgba(0,0,0,0.25)",
|
||||||
|
borderColor: "rgba(0,0,0,0.25)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
Private
|
Private
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@ -212,7 +220,9 @@ export default class SlatePreviewBlock extends Component {
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{this.props.slate.data.body ? (
|
{this.props.slate.data.body ? (
|
||||||
<div css={STYLES_BODY}>{this.props.slate.data.body}</div>
|
<div css={STYLES_BODY}>
|
||||||
|
<ProcessedText text={this.props.slate.data.body} />
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div style={{ height: "8px" }} />
|
<div style={{ height: "8px" }} />
|
||||||
)}
|
)}
|
||||||
|
@ -37,7 +37,10 @@ export class TabGroup extends React.Component {
|
|||||||
css={STYLES_TAB}
|
css={STYLES_TAB}
|
||||||
key={tab}
|
key={tab}
|
||||||
style={{
|
style={{
|
||||||
opacity: this.props.value === i ? "100%" : "25%",
|
color:
|
||||||
|
this.props.value === i
|
||||||
|
? Constants.system.black
|
||||||
|
: "rgba(0,0,0,0.25)",
|
||||||
}}
|
}}
|
||||||
onClick={() => this.props.onChange(i)}
|
onClick={() => this.props.onChange(i)}
|
||||||
>
|
>
|
||||||
|
@ -4,7 +4,7 @@ import * as Strings from "~/common/strings";
|
|||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
let slate = await Data.getSlateById({ id: req.body.data.id });
|
let slate = await Data.getSlateById({ id: req.body.data.id });
|
||||||
if (!slate) {
|
if (!slate || slate.error) {
|
||||||
return res.status(404).send({
|
return res.status(404).send({
|
||||||
decorator: "SLATE_NOT_FOUND",
|
decorator: "SLATE_NOT_FOUND",
|
||||||
error: true,
|
error: true,
|
||||||
@ -13,7 +13,7 @@ export default async (req, res) => {
|
|||||||
slate = Serializers.slate(slate);
|
slate = Serializers.slate(slate);
|
||||||
|
|
||||||
let user = await Data.getUserById({ id: slate.data.ownerId });
|
let user = await Data.getUserById({ id: slate.data.ownerId });
|
||||||
if (!user) {
|
if (!user || user.error) {
|
||||||
return res.status(200).send({
|
return res.status(200).send({
|
||||||
decorator: "SLATE_OWNER_NOT_FOUND",
|
decorator: "SLATE_OWNER_NOT_FOUND",
|
||||||
data: slate,
|
data: slate,
|
||||||
|
@ -4,7 +4,7 @@ import * as Strings from "~/common/strings";
|
|||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
let user = await Data.getUserById({ id: req.body.data.id });
|
let user = await Data.getUserById({ id: req.body.data.id });
|
||||||
if (!user) {
|
if (!user || user.error) {
|
||||||
return res.status(404).send({
|
return res.status(404).send({
|
||||||
decorator: "USER_NOT_FOUND",
|
decorator: "USER_NOT_FOUND",
|
||||||
error: true,
|
error: true,
|
||||||
@ -16,6 +16,14 @@ export default async (req, res) => {
|
|||||||
userId: req.body.data.id,
|
userId: req.body.data.id,
|
||||||
publicOnly: true,
|
publicOnly: true,
|
||||||
});
|
});
|
||||||
|
if (slates.error) {
|
||||||
|
if (!user || user.error) {
|
||||||
|
return res.status(404).send({
|
||||||
|
decorator: "SLATES_NOT_FOUND",
|
||||||
|
error: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
user.slates = [];
|
user.slates = [];
|
||||||
for (let slate of slates) {
|
for (let slate of slates) {
|
||||||
user.slates.push(Serializers.slate(slate));
|
user.slates.push(Serializers.slate(slate));
|
||||||
|
Loading…
Reference in New Issue
Block a user