Skip to content

Commit

Permalink
HF 30 - Fix apps (desktop, Android
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Oct 23, 2024
1 parent 2682be6 commit 29a445f
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 18 deletions.
4 changes: 4 additions & 0 deletions src/components/elements/VerticalMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
padding: 0 1rem 0 3.8rem;
line-height: 50px;

@media screen and (max-width: 39.9375em) {
padding: 0 20px;
}

.Icon {
@include themify($themes) {
fill: themed('textColorPrimary');
Expand Down
16 changes: 10 additions & 6 deletions src/components/modules/CreateGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ import GroupMembers, { validateMembersStep } from 'app/components/modules/groups
import GroupFinal from 'app/components/modules/groups/GroupFinal'
import DialogManager from 'app/components/elements/common/DialogManager'
import { showLoginDialog } from 'app/components/dialogs/LoginDialog'
import isScreenSmall from 'app/utils/isScreenSmall'

const STEPS = () => { return {
name: tt('create_group_jsx.step_name'),
logo: tt('create_group_jsx.step_logo'),
members: tt('create_group_jsx.step_members'),
final: tt('create_group_jsx.step_create')
} }
const STEPS = () => {
const isSmall = isScreenSmall()
return {
name: tt('create_group_jsx.step_name'),
logo: isSmall ? tt('create_group_jsx.step_logo_mobile') : tt('create_group_jsx.step_logo'),
members: isSmall ? tt('create_group_jsx.step_members_mobile') : tt('create_group_jsx.step_members'),
final: isSmall ? tt('create_group_jsx.step_create_mobile') : tt('create_group_jsx.step_create')
}
}

class ActionOnUnmount extends React.Component {
componentWillUnmount() {
Expand Down
23 changes: 17 additions & 6 deletions src/components/modules/groups/MyGroups.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Link } from 'react-router-dom'
import { Map } from 'immutable'
import { api, formatter } from 'golos-lib-js'
import tt from 'counterpart'
import cn from 'classnames'

import DialogManager from 'app/components/elements/common/DialogManager'
import g from 'app/redux/GlobalReducer'
Expand All @@ -15,6 +16,7 @@ import LoadingIndicator from 'app/components/elements/LoadingIndicator'
import MarkNotificationRead from 'app/components/elements/MarkNotificationRead'
import { showLoginDialog } from 'app/components/dialogs/LoginDialog'
import { getGroupLogo, getGroupMeta, getRoleInGroup } from 'app/utils/groups'
import isScreenSmall from 'app/utils/isScreenSmall'

class MyGroups extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -126,10 +128,13 @@ class MyGroups extends React.Component {

const meta = getGroupMeta(json_metadata)

const isSmall = isScreenSmall()

const maxLength = isSmall ? 15 : 20
let title = meta.title || name
let titleShr = title
if (titleShr.length > 20) {
titleShr = titleShr.substring(0, 17) + '...'
if (titleShr.length > maxLength) {
titleShr = titleShr.substring(0, maxLength - 3) + '...'
}

const kebabItems = []
Expand Down Expand Up @@ -161,7 +166,9 @@ class MyGroups extends React.Component {
e.preventDefault()
e.stopPropagation()
}}>
{amPending ? <button className='button hollow alert' title={
{amPending ? <button className={cn('button hollow alert', {
'icon-only': isSmall
})} title={
amPending ? tt('msgs_group_dropdown.pending') : null} onClick={e => {
this.retireCancel(e, group, titleShr, amPending)
}}>
Expand All @@ -172,11 +179,15 @@ class MyGroups extends React.Component {
this.showGroupMembers(e, group, true)
}} title={tt('group_members_jsx.check_pending_hint')}>
<Icon name='voters' size='0_95x' />
<span className='btn-title'>{tt('group_members_jsx.check_pending') + ' (' + pendings + ')'}</span>
<span className='btn-title'>
{(isSmall ? '' : tt('group_members_jsx.check_pending')) + ' (' + pendings + ')'}
</span>
</button> : null}
<button className='button' onClick={e => {
<button className={cn('button', {
'icon-only': (pendings || amPending)
})} onClick={e => {
this.showGroupMembers(e, group)
}}>
}} title={(pendings || amPending) ? tt('my_groups_jsx.members') : null}>
<Icon name='voters' size='0_95x' />
<span className='btn-title'>{tt('my_groups_jsx.members')}</span>
</button>
Expand Down
5 changes: 5 additions & 0 deletions src/components/modules/groups/MyGroups.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@
margin-left: 5px;
vertical-align: middle;
}
.button.icon-only {
.btn-title {
display: none;
}
}
}
3 changes: 1 addition & 2 deletions src/components/pages/Messages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class Messages extends React.Component {
//alert('scrollToMention ' + messages.length)
let nonce
for (const msg of messages) {
console.log(msg.read_date)
if (msg.to === username && msg.read_date && msg.read_date.startsWith('1970')) {
nonce = msg.nonce
break
Expand Down Expand Up @@ -966,7 +965,7 @@ class Messages extends React.Component {
return (<LinkWithDropdown
closeOnClickOutside
dropdownPosition='bottom'
dropdownAlignment='bottom'
dropdownAlignment='right'
dropdownContent={<VerticalMenu className={'VerticalMenu_nav-profile'} items={menuItems} />}
>
<div className='msgs-curruser'>
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@
"submit": "Create",
"step_name": "Name",
"step_logo": "Logo",
"step_logo_mobile": "Logo",
"step_members": "Members",
"step_members_mobile": "Membs",
"step_create": "Create!",
"step_create_mobile": "Go!",
"group_already_exists": "Group already exists.",
"group_min_length": "Min is 3 symbols.",
"golos_power_too_low": "To create group you should have Golos Power at least ",
Expand Down Expand Up @@ -374,6 +377,7 @@
"name": "Name",
"night_mode": "Night Mode",
"ok": "OK",
"or": "or",
"refresh": "Refresh",
"required": "Required",
"replies": "Replies",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@
"submit": "Создать",
"step_name": "Имя",
"step_logo": "Логотип",
"step_logo_mobile": "Лого",
"step_members": "Участники",
"step_members_mobile": "Люди",
"step_create": "Создать!",
"step_create_mobile": "Go!",
"group_already_exists": "Такая группа уже существует.",
"validating": "Проверка существования группы...",
"group_min_length": "Минимум 3 символа.",
Expand Down
11 changes: 7 additions & 4 deletions src/utils/app/SplashUtils.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

export function hideSplash() {
if (process.env.MOBILE_APP) {
try {
try {
if (process.env.MOBILE_APP) {
navigator.splashscreen.hide()
} catch (err) {
console.error('hideSplash', err)
} else if (process.env.DESKTOP_APP) {
if (window.appSplash)
window.appSplash.contentLoaded()
}
} catch (err) {
console.error('hideSplash', err)
}
}

0 comments on commit 29a445f

Please sign in to comment.