How to use the classnames.classNames function in classnames

To help you get started, we’ve selected a few classnames examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lnked / react-starter / app / components / image-crop / index.jsx View on Github external
import * as React from 'react'
import * as PropTypes from 'prop-types'

// http://lapanoid.github.io/redux-cropper/
// https://goshakkk.name/pabla/
// http://dropsofserenity.github.io/react-avatar-cropper/
// http://roadmanfong.github.io/react-cropper/example/

import { classNames } from 'classnames'

const btnClass = classNames({
    btn: true,
    'btn-pressed': true,
    'btn-over': true
})

console.log(btnClass)

// var arr = ['b', { c: true, d: false }];
// classNames('a', arr); // => 'a b c'

// let buttonType = 'primary';
// classNames({ [`btn-${buttonType}`]: true });

// classNames('foo', 'bar'); // => 'foo bar'

// classNames('foo', 'bar'); // => 'foo bar'
github elyukai / optolith-client / src / App / Views / InGame / InGame.js View on Github external
render() {

		var className = classNames('ingame-table', {
			'hide-enemies': this.state.options.hideEnemies,
			'hide-deac': this.state.options.hideDeac
		});

		return (
			<div id="ingame">
				
				<div>
					<div>
						
						</div></div></div>
github elyukai / optolith-client / src / App / Views / InGame / InGameControls.js View on Github external
render() {

		const previousPhaseClassName = classNames( 'previous-phase', this.props.status[0] === 1 &amp;&amp; this.props.status[1] === this.props.maxIni &amp;&amp; 'disabled' );

		const nextPhaseIcon = (this.props.status[1] == 1 || this.props.status[1] == this.props.usedPhases[this.props.usedPhases.length - 1]) ? '\uE5C8' : '\uE409';

		return (
			<div>
				<div>
					<div>Phase</div>
					<div>{this.props.status[1]}</div>
					<div>Runde {this.props.status[0]}</div>
					<div></div>
					<div>{nextPhaseIcon}</div>
				</div>
				<div>
					
					
				</div></div>
github elyukai / optolith-client / src / App / Views / Universal / DropdownNew.js View on Github external
render() {

		const { hint, label, options, value: selected } = this.props;

		const className = classNames( 'dropdown', this.state.isOpen &amp;&amp; 'active', this.props.fullWidth &amp;&amp; 'fullWidth', this.props.disabled &amp;&amp; 'disabled', this.state.position, this.props.className );

		const labelTextElement = this.props.label ? (
			<label>{this.props.label}</label>
		) : this.props.children;

		const style = this.state.isOpen ? (this.props.options.length &lt; 6 ? this.props.options.length * 33 + 1 : 166) : 0;

		const current = this.props.options.filter(arr =&gt; arr[1] == this.props.value);
		const valueText = current.length === 0 ? (this.props.hint ? this.props.hint : '') : current[0][0];

		const downElement = (
			<div style="{{">
				<div style="{{">
					
					
				</div></div>
github elyukai / optolith-client / src / App / Views / InGame / InGameTableRight.js View on Github external
this.props.fighters.map((fighter) =&gt; {

								const className = classNames(fighter.deac &amp;&amp; 'deac', fighter.type == 'f' &amp;&amp; 'enemy');

								const actionsElement = fighter.cast &gt; 0 ? (
									
										<div>
											({2 + fighter.aktm - fighter.aktv}/{fighter.cast})
										</div>
									
								) : (
									
										<div>
											{2 + fighter.aktm - fighter.aktv}
										</div>
									
								);

								return (
github elyukai / optolith-client / src / App / Views / Universal / DropdownToggle.js View on Github external
render() {

		const className = classNames( 'dropdown', this.state.isOpen &amp;&amp; 'active', this.props.fullWidth &amp;&amp; 'fullWidth', this.props.disabled &amp;&amp; 'disabled', this.state.position, this.props.className );

		const labelTextELement = this.props.label ? (
			<label>{this.props.label}</label>
		) : this.props.children;

		const style = this.state.isOpen ? (this.props.options.length &lt; 6 ? this.props.options.length * 33 + 1 : 166) : 0;

		const current = this.props.options.filter(arr =&gt; arr[1] == this.props.value);
		const valueText = current.length === 0 ? (this.props.hint ? this.props.hint : '') : current[0][0];

		const downElement = (
			<div style="{{">
				<div style="{{">
					
						{
							this.props.options.map(option =&gt; {</div></div>
github elyukai / optolith-client / src / App / Views / InGame / InGameTableHealth.js View on Github external
this.props.fighters.map(fighter =&gt; {

								const className = classNames(fighter.deac &amp;&amp; 'deac', fighter.type == 'f' &amp;&amp; 'enemy');

								const auElement = fighter.au &gt; 0 ? (
									
								) : null;

								const aeElement = fighter.ae &gt; 0 ? (
									
								) : null;

								const keElement = fighter.ke &gt; 0 ? (
									
								) : null;

								return (
github elyukai / optolith-client / src / App / Views / InGame / InGameTableIni.js View on Github external
this.props.fighters.map(fighter =&gt; {

								const className = classNames(fighter.deac &amp;&amp; 'deac', fighter.type == 'f' &amp;&amp; 'enemy');

								const indicatorElement = this.props.status[1] == fighter.init || this.props.status[1] == fighter.init - 8 ? (
									<div>{this.props.status[1] == fighter.init ? 1 : 2}</div>
								) : (
									<div></div>
								);

								return (
									
										
											{indicatorElement}
										
									
								);
							})
						}
github elyukai / optolith-client / src / App / Views / InGame / InGameTableLeft.js View on Github external
this.props.fighters.map((fighter) =&gt; {

								const className = classNames('type-' + fighter.type, fighter.deac &amp;&amp; 'deac', fighter.type == 'f' &amp;&amp; 'enemy');

								return (
									
										
											{fighter.ib}
										
										
											<div>
												<div>
													<span>{fighter.init}</span>
													<img alt="" src="">
												</div>
											</div>
										
										
											{fighter.name}
github elyukai / optolith-client / src / App / Views / InGame / InGameTableHealthBar.js View on Github external
render() {

		const className = classNames( 'bar', `bar-${this.props.type}`, this.props.current &gt; 0 &amp;&amp; 'active', this.props.type == 'le' &amp;&amp; this.props.max &lt;= 0 &amp;&amp; 'no-le');

		return (
			<div>
				<div>
					<div style="{{width:"></div>
					<div></div>
				</div>
			</div>
		);
	}
}

classnames

A simple utility for conditionally joining classNames together

MIT
Latest version published 11 months ago

Package Health Score

88 / 100
Full package analysis