diff --git a/assets/eva-icons/post-actions/bookmark-active.png b/assets/eva-icons/post-actions/bookmark-active.png new file mode 100644 index 0000000..123d321 Binary files /dev/null and b/assets/eva-icons/post-actions/bookmark-active.png differ diff --git a/assets/eva-icons/post-actions/bookmark-inactive.png b/assets/eva-icons/post-actions/bookmark-inactive.png new file mode 100644 index 0000000..142f644 Binary files /dev/null and b/assets/eva-icons/post-actions/bookmark-inactive.png differ diff --git a/src/components/posts/post-action-bar.js b/src/components/posts/post-action-bar.js index 543c7c0..2712911 100644 --- a/src/components/posts/post-action-bar.js +++ b/src/components/posts/post-action-bar.js @@ -27,10 +27,8 @@ function reblogCallback(state, updater) { invertField("reblogged", state, updater); } -function downloadCallback(state, updater) { - let newState = state; - newState.downloaded = true; - updater(newState); +function bookmarkCallback(state, updater) { + invertField("bookmarked", state, updater); } const PostActionJsx = (props) => { @@ -41,7 +39,12 @@ const PostActionJsx = (props) => { source = { activeOrNot(props.state[props.field], props.pack) } - style = { styles.icon } /> + style = { + [ + styles.icon, + props.last ? styles.lastIcon : {} + ] + } /> ) } @@ -51,7 +54,7 @@ const PostActionBarJsx = (props) => { favourited: props.favourited, commenting: false, reblogged: props.reblogged, - downloaded: false + bookmarked: false }); const icons = { @@ -67,9 +70,9 @@ const PostActionBarJsx = (props) => { active: require("assets/eva-icons/post-actions/reblog-active.png"), inactive: require("assets/eva-icons/post-actions/reblog-inactive.png") }, - download: { - active: require("assets/eva-icons/post-actions/download-active.png"), - inactive: require("assets/eva-icons/post-actions/download-inactive.png") + bookmark: { + active: require("assets/eva-icons/post-actions/bookmark-active.png"), + inactive: require("assets/eva-icons/post-actions/bookmark-inactive.png") } } return ( @@ -93,10 +96,11 @@ const PostActionBarJsx = (props) => { callback = { () => reblogCallback(state, setState) } /> downloadCallback(state, setState) } /> + callback = { () => bookmarkCallback(state, setState) } /> ) } @@ -111,7 +115,10 @@ const styles = { width: 30, height: 30, marginRight: Dimensions.get("window").width / 20 + }, + lastIcon: { + marginLeft: "auto" } } -export default PostActionBarJsx; \ No newline at end of file +export default PostActionBarJsx;