Skip to content

Instantly share code, notes, and snippets.

View sibelius's full-sized avatar
🦈
give me a feedback https://entria.feedback.house/sibelius

Sibelius Seraphini sibelius

🦈
give me a feedback https://entria.feedback.house/sibelius
View GitHub Profile
@sibelius
sibelius / ex-navigation.md
Created November 10, 2016 13:44 — forked from knowbody/ex-navigation.md
My exponent's ex-navigation docs/thoughts

Exponent - ex-navigation

This is for now, for my personal use only, things might not be correctly explained here. For the official docs please check: https://github.com/exponentjs/ex-navigation/blob/master/README.md

Navigation bar configuration

On every screen you can use the built-in navigation bar, you can add a title, left button, right button or change navigation bar’s style. All you need to do is pass appropriate params to navigationBar in the route configuration:

import React, { Component } from 'react';
@sibelius
sibelius / normalizeStyle.js
Created February 15, 2017 11:00 — forked from richardgill/normalizeStyle.js
Makes React Native components look more consistent on different device sizes. The base size is an iPhone 6.
import _ from 'lodash'
import { Dimensions, PixelRatio } from 'react-native'
import { platformIsIos } from 'expresso-common/common/platform'
const { height } = Dimensions.get('window')
const iphone6Height = 667
const pixelRatio = PixelRatio.get()
const fieldsToNormalize = [
'fontSize',
'lineHeight',
@sibelius
sibelius / Container.js
Created February 22, 2017 20:52 — forked from fdecampredon/Container.js
redux-relay
import React from 'react';
import { container } from 'redux-relay';
@container({
variablesFromState: (state) => ({myVariable: state.myState})
fragments: {
Relay.QL`
viewer {
import React from 'react';
import {storiesOf} from '@kadira/storybook';
import mockRelay from '@loggi/js/mocks/relay';
import {Component} from '../';
import viewer from './fixtures/viewer'; // json data
const relay = {
variables: {
foo: {},
bar: true,
import React from 'react';
import {storiesOf} from '@kadira/storybook';
import mockContext from '<path-to>/js/mocks/context';
import {Component} from '../';
const context = {
user: 'Foo Bar'
};
storiesOf('Component', module)
import React from 'react';
import {storiesOf} from '@kadira/storybook';
import mockRedux from '<path-to>/js/mocks/redux';
import {Component} from '../';
const storeState = {
list: ['foo', 'bar', 'baz'],
someData: {
foo: true,
bar: false
@sibelius
sibelius / Root.js
Created March 7, 2018 17:46 — forked from mike-marcacci/Root.js
Relay Modern SSR
// @flow
import React, { Component } from "react";
import PropTypes from "prop-types";
import App from "./components/App";
type Props = {
environment: *,
queryTracker?: *
};
<?
// this bot tries to match chat messages to previous forum posts and links to them
require_once(__DIR__.'/../app/config.php');
require_once(__DIR__.'/../app/functions.php');
loadDbs(array('users_global','messages','questions'));
type TypesDefinition =
| StringConstructor
| BooleanConstructor
| DateConstructor
type FieldDefinition = {
type: TypesDefinition,
required?: boolean,
default?: boolean,
}
@sibelius
sibelius / environment.js
Created July 23, 2018 18:23 — forked from wbyoung/environment.js
Relay environment while exploring deferred queries
/* @flow */
import {
forOwn,
size,
get,
transform,
noop,
} from 'lodash';