8000 update wording by whysthatso · Pull Request #3 · robinhoodcoop/robinhoodcoop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

update wording #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"prettier.enable": false
}
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"mailgun-js": "^0.22.0",
"sirv-cli": "^0.4.4",
"subscriptions-transport-ws": "^0.9.16",
"svelte-notifications": "^0.9.9",
"svelte-notifications": "0.9.9",
"svelte-observable": "^0.4.0",
"svelte-simple-modal": "^0.4.2",
"svelte-spinner": "^2.0.2",
Expand Down
Binary file added packages/frontend/public/SFMono-Light.otf
Binary file not shown.
Binary file modified packages/frontend/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/frontend/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default {
extensions: ['.js', '.svelte', '.scss'],
}),
svelte({
// dev: !production,
dev: !production,
extensions: ['.svelte','.md'],
preprocess: [
Expand Down
28 changes: 14 additions & 14 deletions packages/frontend/src/lib/graphql.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InMemoryCache } from 'apollo-cache-inmemory'
import { ApolloClient, gql } from 'apollo-boost'
import { WebSocketLink } from 'apollo-link-ws'
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloClient, gql } from 'apollo-boost';
import { WebSocketLink } from 'apollo-link-ws';

export const ALL_MEMBERS = gql`
subscription {
Expand All @@ -12,17 +12,17 @@ export const ALL_MEMBERS = gql`
email
}
}
`
`;

export const MEMBERS = gql`
subscription {
members(orderDirection: asc) {
members(first: 1000, orderDirection: asc) {
id
address
shares
}
}
`
`;

export const SEARCH_MEMBERS = gql`
subscription members($where: Member_filter!) {
Expand All @@ -31,7 +31,7 @@ export const SEARCH_MEMBERS = gql`
shares
}
}
`
`;

export const MEMBER = gql`
subscription member($id: String) {
Expand All @@ -40,7 +40,7 @@ export const MEMBER = gql`
shares
}
}
`
`;

export const ADMINS = gql`
subscription {
Expand All @@ -49,7 +49,7 @@ export const ADMINS = gql`
address
}
}
`
`;

export const SHARE = gql`
subscription {
Expand All @@ -58,16 +58,16 @@ export const SHARE = gql`
timestamp
}
}
`
`;

export const GRAPH_ENDPOINT = 'wss://api.thegraph.com/subgraphs/name/osarrouy/robinhoodcoop'
export const GRAPH_ENDPOINT = 'wss://api.thegraph.com/subgraphs/name/osarrouy/robinhoodcoop';

const link = new WebSocketLink({
uri: GRAPH_ENDPOINT,
options: {
reconnect: true,
},
})
const cache = new InMemoryCache()
});
const cache = new InMemoryCache();

export const graphql = new ApolloClient({ link, cache })
export const graphql = new ApolloClient({ link, cache });
2 changes: 1 addition & 1 deletion packages/frontend/src/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { RHC } from './coop.js'
export { RHS } from './share.js'
export { notify } from './notifications.js'
export { notify, getNotify } from './notifications.js'
export { toDecimals, toFormattedDecimals, toFixed } from './numbers.js'
export { graphql, MEMBER, MEMBERS, ALL_MEMBERS, SHARE, SEARCH_MEMBERS } from './graphql.js'
export { isValidString, isValidEmail } from './validations.js'
Expand Down
36 changes: 36 additions & 0 deletions packages/frontend/src/lib/notifications.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
import { getNotificationsContext } from 'svelte-notifications'

export const getNotify = (addNotification, clearNotifications) => {
return {
default: message => {
addNotification({
position: 'bottom-center',
text: message,
})
},

success: message => {
clearNotifications()

addNotification({
position: 'bottom-center',
type: 'success',
text: message,
removeAfter: 5000,
})
},

error: message => {
clearNotifications()

addNotification({
position: 'bottom-center',
type: 'danger',
text: message,
})
},

clear: () => {
clearNotifications()
},
}
}

export const notify = {
default: message => {
const { addNotification } = getNotificationsContext()
Expand Down
18 changes: 9 additions & 9 deletions packages/frontend/src/lib/validations.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export const isValidString = string => {
export const isValidString = (string) => {
if (string && string.length > 0) {
return true
return true;
}
return false
}
return false;
};

export const isValidEmail = email => {
if (email && /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)) {
return true
export const isValidEmail = (email) => {
if (email && /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(email)) {
return true;
}
return false
}
return false;
};
6 changes: 5 additions & 1 deletion packages/frontend/src/routes/admin/admins/Create.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<script>
import { Form, Input, Submit } from '/components/index.js'
import { notify, isAddress, RHC } from '/lib/index'
import { getNotify, isAddress, RHC } from '/lib/index'
import { Content, Links, Main, Title } from '/sections/admin/index.js'
import { getNotificationsContext } from 'svelte-notifications'
import { Link, navigateTo } from 'yrv'

let coop = RHC.new({ metamask: true })
let loading = false
let admin = ''
let error = ''

const { addNotification, clearNotifications } = getNotificationsContext()
const notify = getNotify(addNotification, clearNotifications)

const validate = async () => {
if (isAddress(admin)) {
if (!await coop.isAdmin(admin)) {
Expand Down
16 changes: 10 additions & 6 deletions packages/frontend/src/routes/admin/admins/List.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<script>
import { Button, Loading } from '/components/index.js'
import { Content, Main, Title } from '/sections/admin/index.js'
import { graphql, ADMINS } from '/lib/graphql'
import { notify, RHC } from '/lib/index'
import { observe } from 'svelte-observable'
import { Link, navigateTo } from 'yrv'
import { Button, Loading } from '/components/index.js'
import { Content, Main, Title } from '/sections/admin/index.js'
import { graphql, ADMINS } from '/lib/graphql'
import { getNotify, RHC } from '/lib/index'
import { getNotificationsContext } from 'svelte-notifications'
import { observe } from 'svelte-observable'
import { Link, navigateTo } from 'yrv'

export let account = ''

Expand All @@ -14,6 +15,9 @@
let admins = []
let search = ''

const { addNotification, clearNotifications } = getNotificationsContext()
const notify = getNotify(addNotification, clearNotifications)

$: {
admins = _admins.filter(admin => admin.address.startsWith(search))
}
Expand Down
5 changes: 4 additions & 1 deletion packages/frontend/src/routes/admin/members/Create.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<script>
import { Form, Input, Submit } from '/components/index.js'
import { notify, isAddress, RHC, toFixed } from '/lib/index'
import { getNotify, isAddress, RHC, toFixed } from '/lib/index'
import { Content, Links, Main, Title } from '/sections/admin/index.js'
import { Link, navigateTo } from 'yrv'
import { getNotificationsContext } from 'svelte-notifications'
import emailjs from 'emailjs-com'

let coop = RHC.new({ metamask: true })
let loading = false
let member = { address: '', email: '', shares: 0 }
let errors = { address: '', email: '', shares: '' }

const { addNotification, clearNotifications } = getNotificationsContext()
const notify = getNotify(addNotification, clearNotifications)
const TEMPLATE_ID = 'membership_confirmation'
const SERVICE_ID = 'robinhoodsmtp'
emailjs.init('user_jzjfr1GQsGlkjbK6QZpqg')
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/routes/admin/members/List.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
let search = ''

$: {
members = _members.filter(member => member.address.startsWith(search))
members = _members.filter(member => member.address.toLowerCase().startsWith(search.toLowerCase()))
}

observe(graphql.subscribe({ query: MEMBERS })).subscribe(async members => {
Expand Down
10 changes: 7 additions & 3 deletions packages/frontend/src/routes/admin/members/edit/Burn.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script>
import { Submit } from '/components/index.js'
import { notify, toDecimals, toFixed, RHC, RHS } from '/lib/index.js'
import { Link, navigateTo } from 'yrv'
import { Submit } from '/components/index.js'
import { getNotify, toDecimals, toFixed, RHC, RHS } from '/lib/index.js'
import { getNotificationsContext } from 'svelte-notifications'
import { Link, navigateTo } from 'yrv'

export let member

Expand All @@ -10,6 +11,9 @@
let loading = false
let share = RHS.new({ metamask: true })
let top = 0

const { addNotification, clearNotifications } = getNotificationsContext()
const notify = getNotify(addNotification, clearNotifications)

$: {
if (member) {
Expand Down
8 changes: 6 additions & 2 deletions packages/frontend/src/routes/admin/members/edit/Mint.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import { Submit } from '/components/index.js'
import { notify, toDecimals, toFixed, RHC, RHS } from '/lib/index.js'
import { Submit } from '/components/index.js'
import { getNotify, toDecimals, toFixed, RHC, RHS } from '/lib/index.js'
import { getNotificationsContext } from 'svelte-notifications'

export let member

Expand All @@ -9,6 +10,9 @@
let loading = false
let share = RHS.new({ metamask: true })

const { addNotification, clearNotifications } = getNotificationsContext()
const notify = getNotify(addNotification, clearNotifications)

const mint = async () => {
loading = true

Expand Down
13 changes: 9 additions & 4 deletions packages/frontend/src/routes/admin/shares/Shares.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script>
import { Submit } from '/components/index.js'
import { Content, Main, Title } from '/sections/admin/index.js'
import { graphql, notify, toFormattedDecimals, toFixed, SHARE, RHC, RHS } from '/lib/index.js'
import { onMount } from 'svelte'
import { Submit } from '/components/index.js'
import { Content, Main, Title } from '/sections/admin/index.js'
import { graphql, getNotify, toFormattedDecimals, toFixed, SHARE, RHC, RHS } from '/lib/index.js'
import { onMount } from 'svelte'
import { getNotificationsContext } from 'svelte-notifications'


let coop = RHC.new({ metamask: true })
let loading = false
Expand All @@ -12,6 +14,9 @@
let timestamp = '...'
let update

const { addNotification, clearNotifications } = getNotificationsContext()
const notify = getNotify(addNotification, clearNotifications)

graphql
.subscribe({
query: SHARE,
Expand Down
37 changes: 28 additions & 9 deletions packages/frontend/src/sections/home/Data.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -104,43 +104,62 @@
<td>€ total</td>
</tr>
</table>
<p class="date info">values as of {timestamp}</p>
</Animate>
<!--p class="date info">values as of {timestamp}</p-->
<p class="date info">values as of 30/06/2020</p>
</Animate>
{:else if $screen === 'signup' && !isSmall}
<Animate>
<table>
<tr>
<td>850</td>
<td>840</td>
<td>members</td>
</tr>
<!--tr>
<td>{members}/td>
<td>members on blockchain</td>
</tr-->
<tr>
<td>19495</td>
<td>total shares</td>
</tr>
<tr>
<td>{supply}</td>
<td>total coop shares</td>
<td>total shares on blockchain</td>
</tr>
<tr>
<td>{value}</td>
<td>EUR per share</td>
</tr>
</table>
<p class="date info">last updated on {timestamp}</p>
</Animate>
<!--p class="date info">last updated on {timestamp}</p -->
<p class="date info">last updated on 30/06/2020</p>
</Animate>
{:else if $screen !== 'signup'}
<Animate>
<table>
<tr>
<td>850</td>
<td>840</td>
<td>members</td>
</tr>
<!--tr>
<td>{members}</td>
<td>members on blockchain</td>
</tr-->
<tr>
<td>19495</td>
<td>total shares</td>
</tr>
<tr>
<td>{supply}</td>
<td>total coop shares</td>
<td>total shares on blockchain</td>
</tr>
<tr>
<td>{value}</td>
<td>EUR per share</td>
</tr>
</table>
<p class="date info">last updated on {timestamp}</p>
<!--p class="date info">last updated on {timestamp}</p -->
<p class="date info">last updated on 30/06/2020</p>
</Animate>
{/if}
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
screen.set('dashboard')
} else {
Member.logout()
message = "Your account needs to be activated by an admin.\nRHcoop will send you an email as soon as your account is ready for log in.\nKeep an eye on your inbox [and spam folder too]."
message = "This account is not registered as a new RHCoop member. Please sign up to your new account if you haven’t yet [even if you already are a RHCoop Member].\nIf you have already signed up, your account now needs to be activated by an admin.\nRHcoop will send you an email as soon as your account is ready for log in.\nKeep an eye on your inbox [and spam folder too]."
}
} catch (err) {
message = err.message
Expand Down
Loading
0