mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-18 10:52:16 +03:00
Merge branch 'development' of https://github.com/ecency/ecency-mobile into nt/foreground-notification
This commit is contained in:
commit
78faa73035
@ -28,7 +28,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.5.5",
|
||||
"@ecency/render-helper": "^2.1.4",
|
||||
"@ecency/render-helper": "^2.1.7",
|
||||
"@esteemapp/dhive": "0.15.0",
|
||||
"@esteemapp/react-native-autocomplete-input": "^4.2.1",
|
||||
"@esteemapp/react-native-modal-popover": "^0.0.15",
|
||||
|
4
src/components/draftListItem/index.js
Normal file
4
src/components/draftListItem/index.js
Normal file
@ -0,0 +1,4 @@
|
||||
import DraftListItem from './view/draftListItemView';
|
||||
|
||||
export { DraftListItem };
|
||||
export default DraftListItem;
|
@ -13,7 +13,7 @@ import { IconButton } from '../../iconButton';
|
||||
import ProgressiveImage from '../../progressiveImage';
|
||||
|
||||
// Styles
|
||||
import styles from './postListItemStyles';
|
||||
import styles from './draftListItemStyles';
|
||||
|
||||
// Defaults
|
||||
const DEFAULT_IMAGE =
|
||||
@ -21,7 +21,7 @@ const DEFAULT_IMAGE =
|
||||
|
||||
const dim = Dimensions.get('window');
|
||||
|
||||
const PostListItemView = ({
|
||||
const DraftListItemView = ({
|
||||
title,
|
||||
summary,
|
||||
mainTag,
|
||||
@ -77,17 +77,19 @@ const PostListItemView = ({
|
||||
</View>
|
||||
<View style={styles.body}>
|
||||
<TouchableOpacity onPress={() => handleOnPressItem(id)}>
|
||||
<ProgressiveImage
|
||||
source={image}
|
||||
thumbnailSource={thumbnail}
|
||||
style={[
|
||||
styles.thumbnail,
|
||||
{ width: dim.width - 16, height: Math.min(calcImgHeight, dim.height) },
|
||||
]}
|
||||
/>
|
||||
{image !== null && (
|
||||
<ProgressiveImage
|
||||
source={image}
|
||||
thumbnailSource={thumbnail}
|
||||
style={[
|
||||
styles.thumbnail,
|
||||
{ width: dim.width - 16, height: Math.min(calcImgHeight, dim.height) },
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
<View style={[styles.postDescripton]}>
|
||||
<Text style={styles.title}>{title}</Text>
|
||||
<Text style={styles.summary}>{summary}</Text>
|
||||
{title !== '' && <Text style={styles.title}>{title}</Text>}
|
||||
{summary !== '' && <Text style={styles.summary}>{summary}</Text>}
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
@ -112,4 +114,4 @@ const PostListItemView = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default injectIntl(PostListItemView);
|
||||
export default injectIntl(DraftListItemView);
|
@ -34,7 +34,7 @@ import { PostDisplay } from './postView';
|
||||
import { PostDropdown } from './postDropdown';
|
||||
import { PostForm } from './postForm';
|
||||
import { PostHeaderDescription, PostBody, Tags } from './postElements';
|
||||
import { PostListItem } from './postListItem';
|
||||
import { DraftListItem } from './draftListItem';
|
||||
import { ProfileSummary } from './profileSummary';
|
||||
import { ProgressiveImage } from './progressiveImage';
|
||||
|
||||
@ -171,7 +171,7 @@ export {
|
||||
PostDropdown,
|
||||
PostForm,
|
||||
PostHeaderDescription,
|
||||
PostListItem,
|
||||
DraftListItem,
|
||||
PostPlaceHolder,
|
||||
Posts,
|
||||
ProductItemLine,
|
||||
|
@ -1,4 +0,0 @@
|
||||
import PostListItem from './view/postListItemView';
|
||||
|
||||
export { PostListItem };
|
||||
export default PostListItem;
|
@ -10,7 +10,7 @@ import { catchDraftImage } from '../../../utils/image';
|
||||
import { getFormatedCreatedDate } from '../../../utils/time';
|
||||
|
||||
// Components
|
||||
import { BasicHeader, TabBar, PostListItem, PostCardPlaceHolder } from '../../../components';
|
||||
import { BasicHeader, TabBar, DraftListItem, PostCardPlaceHolder } from '../../../components';
|
||||
|
||||
// Styles
|
||||
import globalStyles from '../../../globalStyles';
|
||||
@ -48,11 +48,11 @@ const DraftsScreen = ({
|
||||
const tag = tags[0] || '';
|
||||
const image = catchDraftImage(item.body);
|
||||
const thumbnail = catchDraftImage(item.body, 'match', true);
|
||||
const summary = postBodySummary({ item, last_update: item.created }, 100);
|
||||
const summary = postBodySummary({ ...item, last_update: item.created }, 100);
|
||||
const isSchedules = type === 'schedules';
|
||||
|
||||
return (
|
||||
<PostListItem
|
||||
<DraftListItem
|
||||
created={isSchedules ? getFormatedCreatedDate(item.schedule) : item.created}
|
||||
mainTag={tag}
|
||||
title={item.title}
|
||||
|
@ -64,7 +64,7 @@ export const catchEntryImage = (entry, width = 0, height = 0, format = 'match')
|
||||
};
|
||||
|
||||
export const catchDraftImage = (body, format = 'match', thumbnail = false) => {
|
||||
const imgRegex = /(https?:\/\/.*\.(?:tiff?|jpe?g|gif|png|svg|ico|PNG|GIF|JPG))/g;
|
||||
const imgRegex = /(https?:\/\/.*\.(?:png|jpg|jpeg|gif|heic))/gim;
|
||||
format = whatOs === 'android' ? 'webp' : 'match';
|
||||
|
||||
if (body && imgRegex.test(body)) {
|
||||
|
54
yarn.lock
54
yarn.lock
@ -708,10 +708,10 @@
|
||||
exec-sh "^0.3.2"
|
||||
minimist "^1.2.0"
|
||||
|
||||
"@ecency/render-helper@^2.1.4":
|
||||
version "2.1.4"
|
||||
resolved "https://registry.yarnpkg.com/@ecency/render-helper/-/render-helper-2.1.4.tgz#f57e3a06d762c0f9074a18596e7851f4a2f3ac81"
|
||||
integrity sha512-wfVNwE6wX0k3eckOzyLbof1RyklHbCs0e3y7HQrv4WAyxGLQ9aZGc28ernU9DE/dLZZykIoHFFfDLj+CDsq/rw==
|
||||
"@ecency/render-helper@^2.1.7":
|
||||
version "2.1.7"
|
||||
resolved "https://registry.yarnpkg.com/@ecency/render-helper/-/render-helper-2.1.7.tgz#73ed075d7ee3f1c71cb669b463167bd6ed3028aa"
|
||||
integrity sha512-IvGBXLr9C1Kd5p8h/lTOK+rbLA543Ol+NU7z2jC69KE6xFqozLxWm7JJGa8kIjJT4821zp4hyBk3Y3pFGY0yZA==
|
||||
dependencies:
|
||||
he "^1.2.0"
|
||||
lru-cache "^5.1.1"
|
||||
@ -2141,15 +2141,15 @@ browserify-aes@^1.0.6:
|
||||
safe-buffer "^5.0.1"
|
||||
|
||||
browserslist@^4.14.5, browserslist@^4.16.3:
|
||||
version "4.16.3"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.3.tgz#340aa46940d7db878748567c5dea24a48ddf3717"
|
||||
integrity sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw==
|
||||
version "4.16.6"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2"
|
||||
integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==
|
||||
dependencies:
|
||||
caniuse-lite "^1.0.30001181"
|
||||
colorette "^1.2.1"
|
||||
electron-to-chromium "^1.3.649"
|
||||
caniuse-lite "^1.0.30001219"
|
||||
colorette "^1.2.2"
|
||||
electron-to-chromium "^1.3.723"
|
||||
escalade "^3.1.1"
|
||||
node-releases "^1.1.70"
|
||||
node-releases "^1.1.71"
|
||||
|
||||
bs58@^4.0.1:
|
||||
version "4.0.1"
|
||||
@ -2293,10 +2293,10 @@ camelcase@^5.0.0, camelcase@^5.3.1:
|
||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
|
||||
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
|
||||
|
||||
caniuse-lite@^1.0.30001181:
|
||||
version "1.0.30001196"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001196.tgz#00518a2044b1abf3e0df31fadbe5ed90b63f4e64"
|
||||
integrity sha512-CPvObjD3ovWrNBaXlAIGWmg2gQQuJ5YhuciUOjPRox6hIQttu8O+b51dx6VIpIY9ESd2d0Vac1RKpICdG4rGUg==
|
||||
caniuse-lite@^1.0.30001219:
|
||||
version "1.0.30001228"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz#bfdc5942cd3326fa51ee0b42fbef4da9d492a7fa"
|
||||
integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==
|
||||
|
||||
capture-exit@^2.0.0:
|
||||
version "2.0.0"
|
||||
@ -2515,7 +2515,7 @@ color@^3.1.2:
|
||||
color-convert "^1.9.1"
|
||||
color-string "^1.5.4"
|
||||
|
||||
colorette@^1.0.7, colorette@^1.2.1:
|
||||
colorette@^1.0.7, colorette@^1.2.2:
|
||||
version "1.2.2"
|
||||
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
|
||||
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
|
||||
@ -3148,10 +3148,10 @@ ee-first@1.1.1:
|
||||
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
|
||||
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
|
||||
|
||||
electron-to-chromium@^1.3.649:
|
||||
version "1.3.681"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.681.tgz#facd915ae46a020e8be566a2ecdc0b9444439be9"
|
||||
integrity sha512-W6uYvSUTHuyX2DZklIESAqx57jfmGjUkd7Z3RWqLdj9Mmt39ylhBuvFXlskQnvBHj0MYXIeQI+mjiwVddZLSvA==
|
||||
electron-to-chromium@^1.3.723:
|
||||
version "1.3.737"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.737.tgz#196f2e9656f4f3c31930750e1899c091b72d36b5"
|
||||
integrity sha512-P/B84AgUSQXaum7a8m11HUsYL8tj9h/Pt5f7Hg7Ty6bm5DxlFq+e5+ouHUoNQMsKDJ7u4yGfI8mOErCmSH9wyg==
|
||||
|
||||
elegant-spinner@^1.0.1:
|
||||
version "1.0.1"
|
||||
@ -6542,10 +6542,10 @@ node-notifier@^5.2.1, node-notifier@^5.4.2:
|
||||
shellwords "^0.1.1"
|
||||
which "^1.3.0"
|
||||
|
||||
node-releases@^1.1.70:
|
||||
version "1.1.71"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb"
|
||||
integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==
|
||||
node-releases@^1.1.71:
|
||||
version "1.1.72"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe"
|
||||
integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==
|
||||
|
||||
noop-logger@^0.1.1:
|
||||
version "0.1.1"
|
||||
@ -9645,9 +9645,9 @@ xpipe@^1.0.5:
|
||||
integrity sha1-jdi/Rfw/f1Xw4FS4ePQ6YmFNr98=
|
||||
|
||||
xss@^1.0.8:
|
||||
version "1.0.8"
|
||||
resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.8.tgz#32feb87feb74b3dcd3d404b7a68ababf10700535"
|
||||
integrity sha512-3MgPdaXV8rfQ/pNn16Eio6VXYPTkqwa0vc7GkiymmY/DqR1SE/7VPAAVZz1GJsJFrllMYO3RHfEaiUGjab6TNw==
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/xss/-/xss-1.0.9.tgz#3ffd565571ff60d2e40db7f3b80b4677bec770d2"
|
||||
integrity sha512-2t7FahYnGJys6DpHLhajusId7R0Pm2yTmuL0GV9+mV0ZlaLSnb2toBmppATfg5sWIhZQGlsTLoecSzya+l4EAQ==
|
||||
dependencies:
|
||||
commander "^2.20.3"
|
||||
cssfilter "0.0.10"
|
||||
|
Loading…
Reference in New Issue
Block a user