mirror of
https://github.com/hyperspacedev/hyperspace
synced 2025-01-31 09:37:05 +01:00
Prettify failed files
This commit is contained in:
parent
0b995218ea
commit
d67f89d6de
@ -14,7 +14,7 @@ import Post from "../components/Post";
|
||||
import { Status } from "../types/Status";
|
||||
import Mastodon, { StreamListener } from "megalodon";
|
||||
import { withSnackbar } from "notistack";
|
||||
import Masonry from 'react-masonry-css'
|
||||
import Masonry from "react-masonry-css";
|
||||
import { getUserDefaultBool } from "../utilities/settings";
|
||||
import ArrowUpwardIcon from "@material-ui/icons/ArrowUpward";
|
||||
|
||||
@ -38,7 +38,7 @@ class HomePage extends Component<any, IHomePageState> {
|
||||
this.state = {
|
||||
viewIsLoading: true,
|
||||
backlogPosts: null,
|
||||
isMasonryLayout: getUserDefaultBool('isMasonryLayout')
|
||||
isMasonryLayout: getUserDefaultBool("isMasonryLayout")
|
||||
};
|
||||
|
||||
this.client = new Mastodon(
|
||||
@ -159,9 +159,7 @@ class HomePage extends Component<any, IHomePageState> {
|
||||
render() {
|
||||
const { classes } = this.props;
|
||||
const containerClasses = `${classes.pageLayoutMaxConstraints}${
|
||||
this.state.isMasonryLayout
|
||||
? ' ' + classes.pageLayoutMasonry
|
||||
: ''
|
||||
this.state.isMasonryLayout ? " " + classes.pageLayoutMasonry : ""
|
||||
}`;
|
||||
return (
|
||||
<div className={containerClasses}>
|
||||
@ -199,14 +197,18 @@ class HomePage extends Component<any, IHomePageState> {
|
||||
default: 4,
|
||||
2000: 3,
|
||||
1400: 2,
|
||||
1050: 1,
|
||||
1050: 1
|
||||
}}
|
||||
className={classes.masonryGrid}
|
||||
columnClassName={classes['my-masonry-grid_column']}
|
||||
columnClassName={
|
||||
classes["my-masonry-grid_column"]
|
||||
}
|
||||
>
|
||||
{this.state.posts.map((post: Status) => {
|
||||
return (
|
||||
<div className={classes.masonryGrid_item}>
|
||||
<div
|
||||
className={classes.masonryGrid_item}
|
||||
>
|
||||
<Post
|
||||
key={post.id}
|
||||
post={post}
|
||||
|
@ -14,7 +14,7 @@ import Post from "../components/Post";
|
||||
import { Status } from "../types/Status";
|
||||
import Mastodon, { StreamListener } from "megalodon";
|
||||
import { withSnackbar } from "notistack";
|
||||
import Masonry from 'react-masonry-css';
|
||||
import Masonry from "react-masonry-css";
|
||||
import { getUserDefaultBool } from "../utilities/settings";
|
||||
import ArrowUpwardIcon from "@material-ui/icons/ArrowUpward";
|
||||
|
||||
@ -38,7 +38,7 @@ class LocalPage extends Component<any, ILocalPageState> {
|
||||
this.state = {
|
||||
viewIsLoading: true,
|
||||
backlogPosts: null,
|
||||
isMasonryLayout: getUserDefaultBool('isMasonryLayout'),
|
||||
isMasonryLayout: getUserDefaultBool("isMasonryLayout")
|
||||
};
|
||||
|
||||
this.client = new Mastodon(
|
||||
@ -196,14 +196,18 @@ class LocalPage extends Component<any, ILocalPageState> {
|
||||
default: 4,
|
||||
2000: 3,
|
||||
1400: 2,
|
||||
1050: 1,
|
||||
1050: 1
|
||||
}}
|
||||
className={classes.masonryGrid}
|
||||
columnClassName={classes['my-masonry-grid_column']}
|
||||
columnClassName={
|
||||
classes["my-masonry-grid_column"]
|
||||
}
|
||||
>
|
||||
{this.state.posts.map((post: Status) => {
|
||||
return (
|
||||
<div className={classes.masonryGrid_item}>
|
||||
<div
|
||||
className={classes.masonryGrid_item}
|
||||
>
|
||||
<Post
|
||||
key={post.id}
|
||||
post={post}
|
||||
@ -217,7 +221,9 @@ class LocalPage extends Component<any, ILocalPageState> {
|
||||
<div>
|
||||
{this.state.posts.map((post: Status) => {
|
||||
return (
|
||||
<div className={classes.masonryGrid_item}>
|
||||
<div
|
||||
className={classes.masonryGrid_item}
|
||||
>
|
||||
<Post
|
||||
key={post.id}
|
||||
post={post}
|
||||
|
@ -34,21 +34,21 @@ export const styles = (theme: Theme) =>
|
||||
marginTop: 88,
|
||||
padding: theme.spacing.unit * 3,
|
||||
paddingLeft: theme.spacing.unit * 16,
|
||||
paddingRight: theme.spacing.unit * 16,
|
||||
paddingRight: theme.spacing.unit * 16
|
||||
},
|
||||
[theme.breakpoints.up("lg")]: {
|
||||
marginLeft: 250,
|
||||
marginTop: 88,
|
||||
padding: theme.spacing.unit * 3,
|
||||
paddingLeft: theme.spacing.unit * 32,
|
||||
paddingRight: theme.spacing.unit * 32,
|
||||
paddingRight: theme.spacing.unit * 32
|
||||
},
|
||||
[theme.breakpoints.up("xl")]: {
|
||||
marginLeft: 250,
|
||||
marginTop: 88,
|
||||
padding: theme.spacing.unit * 3,
|
||||
paddingLeft: theme.spacing.unit * 40,
|
||||
paddingRight: theme.spacing.unit * 40,
|
||||
paddingRight: theme.spacing.unit * 40
|
||||
},
|
||||
backgroundColor: theme.palette.background.default,
|
||||
minHeight: isDarwinApp() ? "100vh" : "auto"
|
||||
@ -326,13 +326,14 @@ export const styles = (theme: Theme) =>
|
||||
},
|
||||
pageLayoutMasonry: {
|
||||
paddingLeft: theme.spacing.unit * 3,
|
||||
paddingRight: theme.spacing.unit * 3,
|
||||
paddingRight: theme.spacing.unit * 3
|
||||
},
|
||||
masonryGrid: {
|
||||
display: 'flex',
|
||||
width: 'auto',
|
||||
},
|
||||
'my-masonry-grid_column': { // non-standard name fixes react-masonry-css bug :shrug:
|
||||
padding: 5,
|
||||
display: "flex",
|
||||
width: "auto"
|
||||
},
|
||||
"my-masonry-grid_column": {
|
||||
// non-standard name fixes react-masonry-css bug :shrug:
|
||||
padding: 5
|
||||
}
|
||||
});
|
||||
|
@ -14,7 +14,7 @@ import Post from "../components/Post";
|
||||
import { Status } from "../types/Status";
|
||||
import Mastodon, { StreamListener } from "megalodon";
|
||||
import { withSnackbar } from "notistack";
|
||||
import Masonry from 'react-masonry-css';
|
||||
import Masonry from "react-masonry-css";
|
||||
import { getUserDefaultBool } from "../utilities/settings";
|
||||
import ArrowUpwardIcon from "@material-ui/icons/ArrowUpward";
|
||||
|
||||
@ -25,7 +25,7 @@ interface IPublicPageState {
|
||||
viewDidLoad?: boolean;
|
||||
viewDidError?: boolean;
|
||||
viewDidErrorCode?: any;
|
||||
isMasonryLayout?:boolean;
|
||||
isMasonryLayout?: boolean;
|
||||
}
|
||||
|
||||
class PublicPage extends Component<any, IPublicPageState> {
|
||||
@ -38,7 +38,7 @@ class PublicPage extends Component<any, IPublicPageState> {
|
||||
this.state = {
|
||||
viewIsLoading: true,
|
||||
backlogPosts: null,
|
||||
isMasonryLayout: getUserDefaultBool('isMasonryLayout')
|
||||
isMasonryLayout: getUserDefaultBool("isMasonryLayout")
|
||||
};
|
||||
|
||||
this.client = new Mastodon(
|
||||
@ -195,14 +195,18 @@ class PublicPage extends Component<any, IPublicPageState> {
|
||||
default: 4,
|
||||
2000: 3,
|
||||
1400: 2,
|
||||
1050: 1,
|
||||
1050: 1
|
||||
}}
|
||||
className={classes.masonryGrid}
|
||||
columnClassName={classes['my-masonry-grid_column']}
|
||||
columnClassName={
|
||||
classes["my-masonry-grid_column"]
|
||||
}
|
||||
>
|
||||
{this.state.posts.map((post: Status) => {
|
||||
return (
|
||||
<div className={classes.masonryGrid_item}>
|
||||
<div
|
||||
className={classes.masonryGrid_item}
|
||||
>
|
||||
<Post
|
||||
key={post.id}
|
||||
post={post}
|
||||
@ -216,7 +220,9 @@ class PublicPage extends Component<any, IPublicPageState> {
|
||||
<div>
|
||||
{this.state.posts.map((post: Status) => {
|
||||
return (
|
||||
<div className={classes.masonryGrid_item}>
|
||||
<div
|
||||
className={classes.masonryGrid_item}
|
||||
>
|
||||
<Post
|
||||
key={post.id}
|
||||
post={post}
|
||||
|
@ -64,7 +64,7 @@ import UndoIcon from "@material-ui/icons/Undo";
|
||||
import DomainDisabledIcon from "@material-ui/icons/DomainDisabled";
|
||||
import AccountSettingsIcon from "mdi-material-ui/AccountSettings";
|
||||
import AlphabeticalVariantOffIcon from "mdi-material-ui/AlphabeticalVariantOff";
|
||||
import DashboardIcon from '@material-ui/icons/Dashboard'
|
||||
import DashboardIcon from "@material-ui/icons/Dashboard";
|
||||
|
||||
import { Config } from "../types/Config";
|
||||
import { Account } from "../types/Account";
|
||||
@ -120,7 +120,7 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
brandName: "Hyperspace",
|
||||
federated: true,
|
||||
imposeCharacterLimit: getUserDefaultBool("imposeCharacterLimit"),
|
||||
masonryLayout: getUserDefaultBool("isMasonryLayout"),
|
||||
masonryLayout: getUserDefaultBool("isMasonryLayout")
|
||||
};
|
||||
|
||||
this.toggleDarkMode = this.toggleDarkMode.bind(this);
|
||||
@ -129,7 +129,7 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
this.toggleBadgeCount = this.toggleBadgeCount.bind(this);
|
||||
this.toggleThemeDialog = this.toggleThemeDialog.bind(this);
|
||||
this.toggleVisibilityDialog = this.toggleVisibilityDialog.bind(this);
|
||||
this.toggleMasonryLayout = this.toggleMasonryLayout.bind(this)
|
||||
this.toggleMasonryLayout = this.toggleMasonryLayout.bind(this);
|
||||
this.changeThemeName = this.changeThemeName.bind(this);
|
||||
this.changeTheme = this.changeTheme.bind(this);
|
||||
this.setVisibility = this.setVisibility.bind(this);
|
||||
@ -246,11 +246,8 @@ class SettingsPage extends Component<any, ISettingsState> {
|
||||
}
|
||||
|
||||
toggleMasonryLayout() {
|
||||
this.setState({ masonryLayout: !this.state.masonryLayout })
|
||||
setUserDefaultBool(
|
||||
"isMasonryLayout",
|
||||
!this.state.masonryLayout
|
||||
)
|
||||
this.setState({ masonryLayout: !this.state.masonryLayout });
|
||||
setUserDefaultBool("isMasonryLayout", !this.state.masonryLayout);
|
||||
}
|
||||
|
||||
changeTheme() {
|
||||
|
@ -102,7 +102,7 @@ export function createUserDefaults() {
|
||||
displayAllOnNotificationBadge: false,
|
||||
defaultVisibility: "public",
|
||||
imposeCharacterLimit: true,
|
||||
isMasonryLayout: false,
|
||||
isMasonryLayout: false
|
||||
};
|
||||
|
||||
let settings = [
|
||||
@ -112,7 +112,7 @@ export function createUserDefaults() {
|
||||
"displayAllOnNotificationBadge",
|
||||
"defaultVisibility",
|
||||
"imposeCharacterLimit",
|
||||
"isMasonryLayout",
|
||||
"isMasonryLayout"
|
||||
];
|
||||
|
||||
migrateExistingSettings();
|
||||
|
Loading…
x
Reference in New Issue
Block a user