Browse Source

Fix theme primary button colors, fix community button colors

feature/settings-cleanup
GreatBearShark 2 years ago
parent
commit
b49e410a51
  1. 8
      src/components/community.tsx
  2. 6
      src/components/main.tsx
  3. 9
      src/theme.tsx
  4. 4
      src/utils.ts

8
src/components/community.tsx

@ -214,7 +214,8 @@ export class BaseCommunity extends Component<any, State> {
</div>
</div>
{this.state.community.subscribed ? (
<Button
<Button
variant="outline"
onClick={linkEvent(
this.state.community.id,
this.handleUnsubscribe
@ -223,7 +224,8 @@ export class BaseCommunity extends Component<any, State> {
{i18n.t('unsubscribe')}
</Button>
) : (
<Button
<Button
variant="outline"
onClick={linkEvent(
this.state.community.id,
this.handleSubscribe
@ -235,7 +237,7 @@ export class BaseCommunity extends Component<any, State> {
)}
<div className="community-button-separator" />
<Link to={`/create_post?community=${this.state.community.name}`} style={{ display: 'block' }}>
<Button variant="secondary">
<Button variant="primary">
{isMobile ? '+' : 'Create Post'}
</Button>

6
src/components/main.tsx

@ -133,9 +133,9 @@ class Main extends Component<any, MainState> {
loading: true,
posts: [],
comments: [],
listingType: getListingTypeFromProps(this.props),
dataType: getDataTypeFromProps(this.props),
sort: getSortTypeFromProps(this.props),
listingType: getListingTypeFromProps(this.props) || ListingType.Subscribed,
dataType: getDataTypeFromProps(this.props) || DataType.Post,
sort: getSortTypeFromProps(this.props) || SortType.Hot,
page: getPageFromProps(this.props),
filtersOpen: false,
};

9
src/theme.tsx

@ -17,6 +17,7 @@ export const variants = {
'&:hover': {
textDecoration: 'none',
cursor: 'pointer',
color: 'background',
},
'&:disabled': {
opacity: 0.5,
@ -44,7 +45,7 @@ export const variants = {
outline: {
color: 'text',
borderColor: 'muted',
borderWidth: '1px',
borderWidth: '2px',
borderStyle: 'solid',
backgroundColor: 'transparent',
},
@ -73,7 +74,8 @@ const defaultTheme: ThemeProviderProps<Theme> = {
colors: {
...dark.colors,
background: '#222',
primary: '#DA1B9A',
// primary: '#DA1B9A',
primary: '#A4288B',
secondary: '#2030DF',
accent: '#F3B90C',
danger: '#dc3545',
@ -85,6 +87,9 @@ const defaultTheme: ThemeProviderProps<Theme> = {
...variants.buttons.primary,
color: 'text',
bg: 'primary',
'&:hover': {
bg: 'primary',
}
},
secondary: {
...variants.buttons.secondary,

4
src/utils.ts

@ -769,7 +769,7 @@ function communitySearch(text: string, cb: any) {
export function getListingTypeFromProps(props: any): ListingType {
return props.match.params.listing_type
? routeListingTypeToEnum(props.match.params.listing_type)
: UserService.Instance.user
: UserService.Instance.user && UserService.Instance.user.default_listing_type
? UserService.Instance.user.default_listing_type
: ListingType.All;
}
@ -784,7 +784,7 @@ export function getDataTypeFromProps(props: any): DataType {
export function getSortTypeFromProps(props: any): SortType {
return props.match.params.sort
? routeSortTypeToEnum(props.match.params.sort)
: UserService.Instance.user
: UserService.Instance.user && UserService.Instance.user.default_sort_type
? UserService.Instance.user.default_sort_type
: SortType.Hot;
}

Loading…
Cancel
Save