This file contains 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
{this.props.organizationId == "2728d56c-9676-4ce2-a188-77654991333e" ? | |
<Row style={{ | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
}}> | |
<Image | |
source={{ uri: apiDomain + this.props.logo }} | |
style={{ | |
width: deviceWidth * 0.4, |
This file contains 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
""" These are endpoints that get or create cards and rows """ | |
from os import system | |
from random import randint | |
from django.http import JsonResponse | |
from django.utils import timezone | |
from rest_framework.decorators import api_view | |
from rest_framework import generics | |
from background_task import background | |
from background_task.models_completed import CompletedTask | |
from background_task.models import Task |
This file contains 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
(Keep the rest of BallSerializer) | |
def to_representation(self, instance): | |
""" Get rid of excess data, makes it easier to consume on the client """ | |
ret = super().to_representation(instance) | |
ret.pop('updated_at') | |
ret.pop('is_played') | |
return ret |
This file contains 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
""" | |
Form the JSON that we need | |
""" | |
from random import sample | |
from rest_framework import serializers | |
from play.models import Row, Card | |
def card_data(card): | |
""" populates card with 5 rows of random data """ | |
b_column = sample(range(1, 16), k=5) |
This file contains 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 from 'react'; | |
import { Flex } from 'rebass'; | |
import styled from 'styled-components'; | |
import Square from './Square'; | |
import { ICard, IRow } from '../store/cards'; | |
// Create a Title component that'll render an <h1> tag with some styles | |
const BingoHeader = styled.div` | |
width: 132%; | |
margin-left: -15%; |
This file contains 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 from 'react'; | |
import styled from 'styled-components'; | |
import { Flex } from 'rebass'; | |
const FlexHeight = styled(Flex)` | |
height: ${(props) => props.height}; | |
min-width: 0; | |
height: 42px; | |
margin: 1px !important; | |
padding: 4px; |
This file contains 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 { actionTypes } from './actionTypes'; | |
import { action as act } from 'typesafe-actions' | |
import { getCards } from '../webservices/bingoService'; | |
import { Reducer, AnyAction } from 'redux' | |
import { Dispatch } from 'react'; | |
import { danger, clear } from './messages'; | |
/* Card Interface */ | |
export interface ICardArray { |
This file contains 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 * as React from 'react' | |
import styled from 'styled-components'; | |
import { connect } from 'react-redux'; | |
import { Flex } from 'rebass'; | |
import { Container, Row, Spinner } from 'reactstrap'; | |
import { IApplication, IConnectedReduxProps } from '../store/configureStore'; | |
import BingoBoard from './BingoBoard'; | |
import { requestNumbers } from '../store/cards'; | |
import './styles/App.css'; | |
import './styles/bootstrap.css'; |
This file contains 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 { handleResponse } from '../store/events'; | |
export const getCards = async () => { | |
const requestOptions = { | |
method: 'GET' | |
}; | |
const uri = "http://localhost:8000/cards"; | |
return fetch(uri, requestOptions) | |
.then(handleResponse) | |
.then(cards => cards); |
This file contains 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
enum actionTypes { | |
/* Messaging system */ | |
ALERT_SUCCESS = 'ALERT_SUCCESS', | |
ALERT_DANGER = 'ALERT_DANGER', | |
ALERT_CLEAR = 'ALERT_CLEAR', | |
/* Bingo cards */ | |
CARD_REQUEST = 'CARD_REQUEST', | |
CARD_SUCCESS = 'CARD_SUCCESS', | |
CARD_FAILURE = 'CARD_FAILURE', | |
} |
NewerOlder