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
// Support for custom color keys, as well as hexcode | |
export function getColorFromKey(colorKey) { | |
switch (colorKey) { | |
case 'primary': | |
return theme.palette.primary.main; | |
case 'secondary': | |
return theme.palette.secondary.main; | |
case 'textPrimary': | |
return theme.palette.text.primary; | |
case 'textSecondary': |
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
export const getEntitiesByLogic = ({ editorState, findEntity }) => { | |
const content = editorState.getCurrentContent(); | |
const entities = []; | |
content.getBlocksAsArray().forEach(block => { | |
let selectedEntity = null; | |
block.findEntityRanges( | |
character => { | |
if (character.getEntity() !== null) { | |
const entityKey = character.getEntity(); | |
const entity = content.getEntity(entityKey); |
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 { stringify } from 'query-string'; | |
export const sendRequest = ({ | |
url, | |
method, | |
useCredentials=false, | |
body, | |
headers = {}, | |
queryParams = {} | |
}) => { |
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, { useState } from "react"; | |
import styled from "styled-components"; | |
import { | |
MenuItem, | |
MenuList, | |
ClickAwayListener, | |
Paper, | |
Popper | |
} from "@material-ui/core"; | |
import ArrowDropDownOutlinedIcon from "@material-ui/icons/ArrowDropDownOutlined"; |
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, { css } from "styled-components"; | |
import { Avatar } from "@material-ui/core"; | |
// -------------------------- Defining all the css sizes ------------------------ | |
export const SmallestSizeCSS = css` | |
width: 30px; | |
height: 30px; | |
${props => props.theme.breakpoints.up("lg")} { |
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
#Making a table shopify_orders to store some data which helps us keep the shopify and delhivery data in sync | |
class CreateShopifyOrders < ActiveRecord::Migration | |
def change | |
create_table :shopify_orders do |t| | |
t.string :order_id | |
t.string :order_name | |
t.string :sub_order_id | |
t.string :fulfillment_id | |
t.string :godam_status | |
t.string :tracking_number |