This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Main.elm | |
module Main exposing (main) | |
import AppModel exposing (..) | |
import View exposing (view) | |
import Html exposing (Html) | |
main : Program Never Model Msg | |
main = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import Elm from 'react-elm-components'; | |
import Heading from 'grommet-udacity/components/Heading'; | |
import Section from 'grommet-udacity/components/Section'; | |
import Markdown from 'grommet-udacity/components/Markdown'; | |
import Box from 'grommet-udacity/components/Box'; | |
import { StyledWrapper, StyledArticle } from './styles'; | |
import { Main } from 'elm/src/Main'; | |
import { Divider } from 'components'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From https://github.com/RyanCCollins/ryancollinsio/blob/feat_rc_elm/client/webpack.config.babel.js | |
const webpack = require('webpack'); | |
const path = require('path'); | |
const ROOT_PATH = path.resolve(__dirname); | |
module.exports = { | |
devtool: 'eval', | |
entry: [ | |
'react-hot-loader/patch', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const authenticateUser = (user) => ({ | |
type: types.AUTHENTICATE_USER, | |
user, | |
}); | |
export const invalidateUser = () => ({ | |
type: types.INVALIDATE_USER, | |
}); | |
export const logoutUser = () => (dispatch) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module UserMutations | |
// removed for brevity, see the rest | |
// here: https://github.com/RyanCCollins/meetup-event-planner/blob/master/app/graph/mutations/user_mutations.rb | |
UpdateProfile = GraphQL::Relay::Mutation.define do | |
name 'UpdateProfile' | |
description 'Update the user profile' | |
input_field :auth_token, !types.String | |
input_field :profile, ProfileInputType | |
return_field :user, AuthUserType |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Profile extends Component { | |
// Removed for brevity. View the whole component | |
// here: https://github.com/RyanCCollins/meetup-event-planner/tree/master/client/app/src/containers/ProfileContainer | |
handleSaving() { | |
const { | |
updateProfile, | |
bioInput, | |
avatarInput, | |
employerInput, | |
actions, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateEvent extends Component { | |
// ... | |
handleSubmit() { | |
const { | |
actions, | |
mutate, | |
fields, | |
guestList, | |
user, | |
} = this.props; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module EventMutations | |
Create = GraphQL::Relay::Mutation.define do | |
name 'CreateEvent' | |
input_field :event, EventInputType | |
input_field :auth_token, !types.String | |
return_field :event, EventType | |
resolve -> (inputs, ctx) do | |
event_inputs = inputs[:event] | |
start_date = Date.strptime(event_inputs[:start_date], '%m/%d/%Y').to_datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
field :events, types[EventType] do | |
argument :first, types.Int | |
resolve -> (obj, args, ctx) { | |
events = Event.all.sort_by(&:start_date).reverse | |
if args[:first] | |
events = events.first(args[:first]) | |
end | |
events | |
} | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import dependencies here | |
class EventsContainer extends Component { | |
constructor() { | |
super(); | |
this.handleMore = this.handleMore.bind(this); | |
} | |
handleMore() { | |
const { | |
actions, | |
refetch, |