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 from 'react'; | |
const Icon = ({ type }) => ( | |
<i className={'fa fa-'+type}></i> | |
) | |
export default Icon; |
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 { connect } from 'react-redux'; | |
import { requestSomething } from '../actions/compActions'; | |
class Comp1 extends Component { | |
componentDidMount() { | |
this.props.requestSomething(); | |
} | |
render() { |
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
@{ | |
var labels = JsonConvert.SerializeObject(Model.Current); | |
} |
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
using System.Web.Mvc; | |
using SomeName.Project.Areas.Layout.Models; | |
using SomeName.Project.Areas.Layout.ViewModels; | |
using EPiServer.Shell; | |
using EPiServer.Web.Mvc; | |
namespace SomeName.Project.Areas.Layout.Controllers | |
{ |
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
private readonly IContentLoader _contentLoader; | |
private readonly UrlResolver _urlResolver; | |
public PageController(IContentLoader contentLoader) | |
{ | |
_contentLoader = contentLoader; | |
_urlResolver = ServiceLocator.Current.GetInstance<UrlResolver>(); | |
} |
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 redirectWithPayload = (url = "", payload = {}) => { | |
const f = document.createElement('form'); | |
f.method = 'post'; | |
f.action = url; | |
Object.keys(payload).forEach(function(key) { | |
const i = document.createElement('input'); | |
i.name = key; | |
i.type = 'hidden' |
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 formatMoney = (amount, decimalCount = 2, decimal = ".", thousands = ",") => { | |
try { | |
decimalCount = Math.abs(decimalCount); | |
decimalCount = isNaN(decimalCount) ? 2 : decimalCount; | |
const negativeSign = amount < 0 ? "-" : ""; | |
let i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString(); | |
let j = (i.length > 3) ? i.length % 3 : 0; |
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'; | |
class Comp1 extends Component { | |
render() { | |
return ( | |
<div></div> | |
); | |
} | |
} |