diff options
| author | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-21 19:41:20 +0500 |
|---|---|---|
| committer | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-21 19:41:20 +0500 |
| commit | fe9e39d9e4c30b25f492ea01d12e72257cede28e (patch) | |
| tree | 35dd1b0d76a7f1b5e2d54170967a24904745145e | |
| parent | Separate filters component (diff) | |
| download | githunt-fe9e39d9e4c30b25f492ea01d12e72257cede28e.tar.gz | |
Language and view filters
| -rw-r--r-- | package.json | 1 | ||||
| -rw-r--r-- | src/components/filters/index.js | 20 | ||||
| -rw-r--r-- | src/components/filters/language-filter/index.js | 53 | ||||
| -rw-r--r-- | src/components/filters/language-filter/languages.json | 1222 | ||||
| -rw-r--r-- | src/components/filters/language-filter/styles.css | 98 | ||||
| -rw-r--r-- | src/components/filters/styles.css | 33 | ||||
| -rw-r--r-- | src/components/filters/view-filter/index.js | 20 | ||||
| -rw-r--r-- | src/components/filters/view-filter/styles.css | 20 | ||||
| -rw-r--r-- | src/global.css | 8 | ||||
| -rw-r--r-- | yarn.lock | 208 |
10 files changed, 1438 insertions, 245 deletions
diff --git a/package.json b/package.json index fdd0fc9..6b8effe 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "react-router": "^4.3.1", "react-router-dom": "^4.3.1", "react-scripts": "1.1.4", - "react-select": "^2.0.0", "redux": "^4.0.0", "redux-persist": "^5.10.0", "redux-thunk": "^2.3.0" diff --git a/src/components/filters/index.js b/src/components/filters/index.js index aa5860b..521e486 100644 --- a/src/components/filters/index.js +++ b/src/components/filters/index.js @@ -1,22 +1,16 @@ import React from 'react'; +import LanguageFilter from './language-filter'; +import ViewFilter from './view-filter'; import './styles.css'; const Filters = (props) => ( <div className="filters-wrap"> - <a href="#" className="btn btn-light language-filter"> - <i className="fa fa-filter mr-2"></i> - All Languages - </a> - <div className="view-type btn"> - <a href="#" className="active"> - <i className="fa fa-list mr-2"></i> - List - </a> - <a href="#"> - <i className="fa fa-table mr-2"></i> - Grid - </a> + <div className="filter-item"> + <LanguageFilter/> + </div> + <div className="filter-item"> + <ViewFilter/> </div> </div> ); diff --git a/src/components/filters/language-filter/index.js b/src/components/filters/language-filter/index.js new file mode 100644 index 0000000..51fc626 --- /dev/null +++ b/src/components/filters/language-filter/index.js @@ -0,0 +1,53 @@ +import React from 'react'; + +import './styles.css'; +import languages from './languages'; + +class LanguageFilter extends React.Component { + + state = { + selected: '' + }; + + renderLanguages() { + const availableLanguages = [ + { + title: 'All Languages', + value: '' + }, + ...languages + ]; + + return availableLanguages.map((language, counter) => { + return ( + <a className="select-menu-item" key={ counter }> + <span className="select-menu-item-text js-select-button-text js-navigation-open">{ language.title }</span> + </a> + ); + }); + } + + render() { + return ( + <div className='language-filter-wrap'> + <a href="#" className="btn btn-light language-filter shadowed"> + <i className="fa fa-filter mr-2"></i> + { this.state.selected || 'All Languages' } + </a> + <div className="language-select"> + <div className="select-menu-header"> + <span className="select-menu-title">Search Language</span> + </div> + <div className="select-menu-filters"> + <div className="select-menu-text-filter"> + <input type="text" id="text-filter-field" className="form-control js-filterable-field js-navigation-enable" placeholder="Filter Languages" aria-label="Type or choose a language"/> + </div> + </div> + <div className="select-menu-list">{ this.renderLanguages() }</div> + </div> + </div> + ); + } +} + +export default LanguageFilter; diff --git a/src/components/filters/language-filter/languages.json b/src/components/filters/language-filter/languages.json new file mode 100644 index 0000000..b0ddf6f --- /dev/null +++ b/src/components/filters/language-filter/languages.json @@ -0,0 +1,1222 @@ +[ + { + "title": "ABAP", + "value": "ABAP" + }, + { + "title": "ActionScript", + "value": "ActionScript" + }, + { + "title": "Ada", + "value": "Ada" + }, + { + "title": "Agda", + "value": "Agda" + }, + { + "title": "AGS", + "value": "AGS" + }, + { + "title": "Alloy", + "value": "Alloy" + }, + { + "title": "AMPL", + "value": "AMPL" + }, + { + "title": "ANTLR", + "value": "ANTLR" + }, + { + "title": "ApacheConf", + "value": "ApacheConf" + }, + { + "title": "Apex", + "value": "Apex" + }, + { + "title": "API", + "value": "API" + }, + { + "title": "APL", + "value": "APL" + }, + { + "title": "AppleScript", + "value": "AppleScript" + }, + { + "title": "Arc", + "value": "Arc" + }, + { + "title": "Arduino", + "value": "Arduino" + }, + { + "title": "ASP", + "value": "ASP" + }, + { + "title": "AspectJ", + "value": "AspectJ" + }, + { + "title": "Assembly", + "value": "Assembly" + }, + { + "title": "ATS", + "value": "ATS" + }, + { + "title": "Augeas", + "value": "Augeas" + }, + { + "title": "AutoHotkey", + "value": "AutoHotkey" + }, + { + "title": "AutoIt", + "value": "AutoIt" + }, + { + "title": "Awk", + "value": "Awk" + }, + { + "title": "Batchfile", + "value": "Batchfile" + }, + { + "title": "Befunge", + "value": "Befunge" + }, + { + "title": "Bison", + "value": "Bison" + }, + { + "title": "BitBake", + "value": "BitBake" + }, + { + "title": "BlitzBasic", + "value": "BlitzBasic" + }, + { + "title": "BlitzMax", + "value": "BlitzMax" + }, + { + "title": "Bluespec", + "value": "Bluespec" + }, + { + "title": "Boo", + "value": "Boo" + }, + { + "title": "Brainfuck", + "value": "Brainfuck" + }, + { + "title": "Brightscript", + "value": "Brightscript" + }, + { + "title": "Bro", + "value": "Bro" + }, + { + "title": "C", + "value": "C" + }, + { + "title": "CSharp", + "value": "CSharp" + }, + { + "title": "C", + "value": "C" + }, + { + "title": "Cap", + "value": "Cap" + }, + { + "title": "CartoCSS", + "value": "CartoCSS" + }, + { + "title": "Ceylon", + "value": "Ceylon" + }, + { + "title": "Chapel", + "value": "Chapel" + }, + { + "title": "Charity", + "value": "Charity" + }, + { + "title": "ChucK", + "value": "ChucK" + }, + { + "title": "Cirru", + "value": "Cirru" + }, + { + "title": "Clarion", + "value": "Clarion" + }, + { + "title": "Clean", + "value": "Clean" + }, + { + "title": "Click", + "value": "Click" + }, + { + "title": "CLIPS", + "value": "CLIPS" + }, + { + "title": "Clojure", + "value": "Clojure" + }, + { + "title": "CMake", + "value": "CMake" + }, + { + "title": "COBOL", + "value": "COBOL" + }, + { + "title": "CoffeeScript", + "value": "CoffeeScript" + }, + { + "title": "ColdFusion", + "value": "ColdFusion" + }, + { + "title": "Common", + "value": "Common" + }, + { + "title": "Component", + "value": "Component" + }, + { + "title": "Cool", + "value": "Cool" + }, + { + "title": "Coq", + "value": "Coq" + }, + { + "title": "Crystal", + "value": "Crystal" + }, + { + "title": "CSS", + "value": "CSS" + }, + { + "title": "Cucumber", + "value": "Cucumber" + }, + { + "title": "Cuda", + "value": "Cuda" + }, + { + "title": "Cycript", + "value": "Cycript" + }, + { + "title": "D", + "value": "D" + }, + { + "title": "Darcs", + "value": "Darcs" + }, + { + "title": "Dart", + "value": "Dart" + }, + { + "title": "Diff", + "value": "Diff" + }, + { + "title": "DIGITAL", + "value": "DIGITAL" + }, + { + "title": "DM", + "value": "DM" + }, + { + "title": "Dogescript", + "value": "Dogescript" + }, + { + "title": "DTrace", + "value": "DTrace" + }, + { + "title": "Dylan", + "value": "Dylan" + }, + { + "title": "E", + "value": "E" + }, + { + "title": "Eagle", + "value": "Eagle" + }, + { + "title": "eC", + "value": "eC" + }, + { + "title": "ECL", + "value": "ECL" + }, + { + "title": "Eiffel", + "value": "Eiffel" + }, + { + "title": "Elixir", + "value": "Elixir" + }, + { + "title": "Elm", + "value": "Elm" + }, + { + "title": "Emacs", + "value": "Emacs" + }, + { + "title": "EmberScript", + "value": "EmberScript" + }, + { + "title": "Erlang", + "value": "Erlang" + }, + { + "title": "F", + "value": "F" + }, + { + "title": "Factor", + "value": "Factor" + }, + { + "title": "Fancy", + "value": "Fancy" + }, + { + "title": "Fantom", + "value": "Fantom" + }, + { + "title": "FLUX", + "value": "FLUX" + }, + { + "title": "Forth", + "value": "Forth" + }, + { + "title": "FORTRAN", + "value": "FORTRAN" + }, + { + "title": "FreeMarker", + "value": "FreeMarker" + }, + { + "title": "Frege", + "value": "Frege" + }, + { + "title": "Game", + "value": "Game" + }, + { + "title": "GAMS", + "value": "GAMS" + }, + { + "title": "GAP", + "value": "GAP" + }, + { + "title": "GDScript", + "value": "GDScript" + }, + { + "title": "Genshi", + "value": "Genshi" + }, + { + "title": "Gettext", + "value": "Gettext" + }, + { + "title": "GLSL", + "value": "GLSL" + }, + { + "title": "Glyph", + "value": "Glyph" + }, + { + "title": "Gnuplot", + "value": "Gnuplot" + }, + { + "title": "Go", + "value": "Go" + }, + { + "title": "Golo", + "value": "Golo" + }, + { + "title": "Gosu", + "value": "Gosu" + }, + { + "title": "Grace", + "value": "Grace" + }, + { + "title": "Grammatical", + "value": "Grammatical" + }, + { + "title": "Groff", + "value": "Groff" + }, + { + "title": "Groovy", + "value": "Groovy" + }, + { + "title": "Hack", + "value": "Hack" + }, + { + "title": "Handlebars", + "value": "Handlebars" + }, + { + "title": "Harbour", + "value": "Harbour" + }, + { + "title": "Haskell", + "value": "Haskell" + }, + { + "title": "Haxe", + "value": "Haxe" + }, + { + "title": "HCL", + "value": "HCL" + }, + { + "title": "HLSL", + "value": "HLSL" + }, + { + "title": "HTML", + "value": "HTML" + }, + { + "title": "Hy", + "value": "Hy" + }, + { + "title": "HyPhy", + "value": "HyPhy" + }, + { + "title": "IDL", + "value": "IDL" + }, + { + "title": "Idris", + "value": "Idris" + }, + { + "title": "IGOR", + "value": "IGOR" + }, + { + "title": "Inform", + "value": "Inform" + }, + { + "title": "Inno", + "value": "Inno" + }, + { + "title": "Io", + "value": "Io" + }, + { + "title": "Ioke", + "value": "Ioke" + }, + { + "title": "Isabelle", + "value": "Isabelle" + }, + { + "title": "J", + "value": "J" + }, + { + "title": "Jasmin", + "value": "Jasmin" + }, + { + "title": "Java", + "value": "Java" + }, + { + "title": "JavaScript", + "value": "JavaScript" + }, + { + "title": "JFlex", + "value": "JFlex" + }, + { + "title": "JSONiq", + "value": "JSONiq" + }, + { + "title": "Julia", + "value": "Julia" + }, + { + "title": "Jupyter", + "value": "Jupyter" + }, + { + "title": "KiCad", + "value": "KiCad" + }, + { + "title": "Kit", + "value": "Kit" + }, + { + "title": "Kotlin", + "value": "Kotlin" + }, + { + "title": "KRL", + "value": "KRL" + }, + { + "title": "LabVIEW", + "value": "LabVIEW" + }, + { + "title": "Lasso", + "value": "Lasso" + }, + { + "title": "Lean", + "value": "Lean" + }, + { + "title": "Lex", + "value": "Lex" + }, + { + "title": "LilyPond", + "value": "LilyPond" + }, + { + "title": "Limbo", + "value": "Limbo" + }, + { + "title": "Liquid", + "value": "Liquid" + }, + { + "title": "LiveScript", + "value": "LiveScript" + }, + { + "title": "LLVM", + "value": "LLVM" + }, + { + "title": "Logos", + "value": "Logos" + }, + { + "title": "Logtalk", + "value": "Logtalk" + }, + { + "title": "LOLCODE", + "value": "LOLCODE" + }, + { + "title": "LookML", + "value": "LookML" + }, + { + "title": "LoomScript", + "value": "LoomScript" + }, + { + "title": "LSL", + "value": "LSL" + }, + { + "title": "Lua", + "value": "Lua" + }, + { + "title": "M", + "value": "M" + }, + { + "title": "M4", + "value": "M4" + }, + { + "title": "Makefile", + "value": "Makefile" + }, + { + "title": "Mako", + "value": "Mako" + }, + { + "title": "Markdown", + "value": "Markdown" + }, + { + "title": "Mask", + "value": "Mask" + }, + { + "title": "Mathematica", + "value": "Mathematica" + }, + { + "title": "Matlab", + "value": "Matlab" + }, + { + "title": "Max", + "value": "Max" + }, + { + "title": "MAXScript", + "value": "MAXScript" + }, + { + "title": "Mercury", + "value": "Mercury" + }, + { + "title": "Metal", + "value": "Metal" + }, + { + "title": "MiniD", + "value": "MiniD" + }, + { + "title": "Mirah", + "value": "Mirah" + }, + { + "title": "Modelica", + "value": "Modelica" + }, + { + "title": "Modula", + "value": "Modula" + }, + { + "title": "Module", + "value": "Module" + }, + { + "title": "Monkey", + "value": "Monkey" + }, + { + "title": "Moocode", + "value": "Moocode" + }, + { + "title": "MoonScript", + "value": "MoonScript" + }, + { + "title": "MTML", + "value": "MTML" + }, + { + "title": "mupad", + "value": "mupad" + }, + { + "title": "Myghty", + "value": "Myghty" + }, + { + "title": "NCL", + "value": "NCL" + }, + { + "title": "Nemerle", + "value": "Nemerle" + }, + { + "title": "nesC", + "value": "nesC" + }, + { + "title": "NetLinx", + "value": "NetLinx" + }, + { + "title": "NetLinx", + "value": "NetLinx" + }, + { + "title": "NetLogo", + "value": "NetLogo" + }, + { + "title": "NewLisp", + "value": "NewLisp" + }, + { + "title": "Nginx", + "value": "Nginx" + }, + { + "title": "Nimrod", + "value": "Nimrod" + }, + { + "title": "Nit", + "value": "Nit" + }, + { + "title": "Nix", + "value": "Nix" + }, + { + "title": "NSIS", + "value": "NSIS" + }, + { + "title": "Nu", + "value": "Nu" + }, + { + "title": "Objective", + "value": "Objective" + }, + { + "title": "Objective", + "value": "Objective" + }, + { + "title": "Objective", + "value": "Objective" + }, + { + "title": "OCaml", + "value": "OCaml" + }, + { + "title": "Omgrofl", + "value": "Omgrofl" + }, + { + "title": "ooc", + "value": "ooc" + }, + { + "title": "Opa", + "value": "Opa" + }, + { + "title": "Opal", + "value": "Opal" + }, + { + "title": "OpenEdge", + "value": "OpenEdge" + }, + { + "title": "OpenSCAD", + "value": "OpenSCAD" + }, + { + "title": "Ox", + "value": "Ox" + }, + { + "title": "Oxygene", + "value": "Oxygene" + }, + { + "title": "Oz", + "value": "Oz" + }, + { + "title": "Pan", + "value": "Pan" + }, + { + "title": "Papyrus", + "value": "Papyrus" + }, + { + "title": "Parrot", + "value": "Parrot" + }, + { + "title": "Pascal", + "value": "Pascal" + }, + { + "title": "PAWN", + "value": "PAWN" + }, + { + "title": "Perl", + "value": "Perl" + }, + { + "title": "Perl6", + "value": "Perl6" + }, + { + "title": "PHP", + "value": "PHP" + }, + { + "title": "PicoLisp", + "value": "PicoLisp" + }, + { + "title": "PigLatin", + "value": "PigLatin" + }, + { + "title": "Pike", + "value": "Pike" + }, + { + "title": "PLpgSQL", + "value": "PLpgSQL" + }, + { + "title": "PLSQL", + "value": "PLSQL" + }, + { + "title": "PogoScript", + "value": "PogoScript" + }, + { + "title": "Pony", + "value": "Pony" + }, + { + "title": "PostScript", + "value": "PostScript" + }, + { + "title": "POV", + "value": "POV" + }, + { + "title": "PowerShell", + "value": "PowerShell" + }, + { + "title": "Processing", + "value": "Processing" + }, + { + "title": "Prolog", + "value": "Prolog" + }, + { + "title": "Propeller", + "value": "Propeller" + }, + { + "title": "Protocol", + "value": "Protocol" + }, + { + "title": "Puppet", + "value": "Puppet" + }, + { + "title": "Pure", + "value": "Pure" + }, + { + "title": "PureBasic", + "value": "PureBasic" + }, + { + "title": "PureScript", + "value": "PureScript" + }, + { + "title": "Python", + "value": "Python" + }, + { + "title": "QMake", + "value": "QMake" + }, + { + "title": "QML", + "value": "QML" + }, + { + "title": "R", + "value": "R" + }, + { + "title": "Racket", + "value": "Racket" + }, + { + "title": "Ragel", + "value": "Ragel" + }, + { + "title": "RAML", + "value": "RAML" + }, + { + "title": "RDoc", + "value": "RDoc" + }, + { + "title": "REALbasic", + "value": "REALbasic" + }, + { + "title": "Rebol", + "value": "Rebol" + }, + { + "title": "Red", + "value": "Red" + }, + { + "title": "Redcode", + "value": "Redcode" + }, + { + "title": "Ren", + "value": "Ren" + }, + { + "title": "RenderScript", + "value": "RenderScript" + }, + { + "title": "RobotFramework", + "value": "RobotFramework" + }, + { + "title": "Rouge", + "value": "Rouge" + }, + { + "title": "Ruby", + "value": "Ruby" + }, + { + "title": "Rust", + "value": "Rust" + }, + { + "title": "SaltStack", + "value": "SaltStack" + }, + { + "title": "SAS", + "value": "SAS" + }, + { + "title": "Scala", + "value": "Scala" + }, + { + "title": "Scheme", + "value": "Scheme" + }, + { + "title": "Scilab", + "value": "Scilab" + }, + { + "title": "Self", + "value": "Self" + }, + { + "title": "Shell", + "value": "Shell" + }, + { + "title": "ShellSession", + "value": "ShellSession" + }, + { + "title": "Shen", + "value": "Shen" + }, + { + "title": "Slash", + "value": "Slash" + }, + { + "title": "Smali", + "value": "Smali" + }, + { + "title": "Smalltalk", + "value": "Smalltalk" + }, + { + "title": "Smarty", + "value": "Smarty" + }, + { + "title": "SMT", + "value": "SMT" + }, + { + "title": "SourcePawn", + "value": "SourcePawn" + }, + { + "title": "SQF", + "value": "SQF" + }, + { + "title": "SQL", + "value": "SQL" + }, + { + "title": "SQLPL", + "value": "SQLPL" + }, + { + "title": "Squirrel", + "value": "Squirrel" + }, + { + "title": "Stan", + "value": "Stan" + }, + { + "title": "Standard", + "value": "Standard" + }, + { + "title": "Stata", + "value": "Stata" + }, + { + "title": "SuperCollider", + "value": "SuperCollider" + }, + { + "title": "Swift", + "value": "Swift" + }, + { + "title": "SystemVerilog", + "value": "SystemVerilog" + }, + { + "title": "Tcl", + "value": "Tcl" + }, + { + "title": "Tea", + "value": "Tea" + }, + { + "title": "TeX", + "value": "TeX" + }, + { + "title": "Thrift", + "value": "Thrift" + }, + { + "title": "Turing", + "value": "Turing" + }, + { + "title": "TXL", + "value": "TXL" + }, + { + "title": "TypeScript", + "value": "TypeScript" + }, + { + "title": "Uno", + "value": "Uno" + }, + { + "title": "UnrealScript", + "value": "UnrealScript" + }, + { + "title": "UrWeb", + "value": "UrWeb" + }, + { + "title": "Vala", + "value": "Vala" + }, + { + "title": "VCL", + "value": "VCL" + }, + { + "title": "Verilog", + "value": "Verilog" + }, + { + "title": "VHDL", + "value": "VHDL" + }, + { + "title": "VimL", + "value": "VimL" + }, + { + "title": "Visual", + "value": "Visual" + }, + { + "title": "Volt", + "value": "Volt" + }, + { + "title": "Vue", + "value": "Vue" + }, + { + "title": "Web", + "value": "Web" + }, + { + "title": "WebIDL", + "value": "WebIDL" + }, + { + "title": "wisp", + "value": "wisp" + }, + { + "title": "X10", + "value": "X10" + }, + { + "title": "xBase", + "value": "xBase" + }, + { + "title": "XC", + "value": "XC" + }, + { + "title": "XML", + "value": "XML" + }, + { + "title": "Xojo", + "value": "Xojo" + }, + { + "title": "XPages", + "value": "XPages" + }, + { + "title": "XProc", + "value": "XProc" + }, + { + "title": "XQuery", + "value": "XQuery" + }, + { + "title": "XS", + "value": "XS" + }, + { + "title": "XSLT", + "value": "XSLT" + }, + { + "title": "Xtend", + "value": "Xtend" + }, + { + "title": "Yacc", + "value": "Yacc" + }, + { + "title": "Zephir", + "value": "Zephir" + }, + { + "title": "Zimpl", + "value": "Zimpl" + } +] diff --git a/src/components/filters/language-filter/styles.css b/src/components/filters/language-filter/styles.css new file mode 100644 index 0000000..74a6cae --- /dev/null +++ b/src/components/filters/language-filter/styles.css @@ -0,0 +1,98 @@ +.language-filter-wrap { + position: relative; +} + +.language-filter { + border-radius: 8px; + padding: 10px 20px; + background: white; + cursor: default; + display: block; +} + +.language-select { + position: absolute; + top: 100%; + width: 300px; + margin-top: 5px; + overflow: hidden; + font-size: 12px; + color: #586069; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #e8e8e8; + border-radius: 8px; + box-shadow: 0 3px 12px rgba(27, 31, 35, 0.15); +} + +.select-menu-header, .select-menu-divider { + padding: 12px 10px; + background: white; + border-bottom: 1px solid #e8e8e8; + font-size: 15px; +} + +.select-menu-header .select-menu-title, .select-menu-divider { + font-weight: 600; + color: #24292e; +} + +.select-menu-filters { + background-color: #f4f4f4; +} + +.select-menu-text-filter { + padding: 10px; + border-bottom: 1px solid #e8e8e8; +} + +.select-menu-text-filter input { + display: block; + font-size: 14px; + width: 100%; + max-width: 100%; + border: 1px solid #dfe2e5 !important; + padding: 5px 10px !important; + border-radius: 3px; + box-shadow: none !important; + outline: none !important; +} + +.select-menu-list { + position: relative; + max-height: 400px; + overflow: auto; +} + +.select-menu-item { + text-align: left; + background-color: #fff; + border-top: 0; + border-right: 0; + border-left: 0; + display: block; + padding: 10px 8px 10px 16px; + overflow: hidden; + color: inherit; + cursor: pointer; + border-bottom: 1px solid #e8e8e8; +} + +.select-menu-item:hover .select-menu-item-text { + color: white; +} + +.select-menu-list .select-menu-item:last-child { + border-bottom: none; +} + +.select-menu-item:hover { + color: #fff; + background-color: #1157ed; + text-decoration: none; +} + +.select-menu-item-text { + display: block; + text-align: left; +} diff --git a/src/components/filters/styles.css b/src/components/filters/styles.css index 810b7f3..3a97edb 100644 --- a/src/components/filters/styles.css +++ b/src/components/filters/styles.css @@ -1,32 +1,7 @@ -.btn.view-type, .btn.language-filter { - display: inline; - box-shadow: 0 9px 62px -13px rgba(0, 0, 0, 0.20); +.filters-wrap .filter-item { + float: left; } -.filters-wrap .view-type.btn { - border-radius: 8px; - padding: 10px 20px; - background: white; - margin-left: 10px; - cursor: default; -} - -.language-filter { - border-radius: 8px; - padding: 10px 20px; - background-color: white; -} - -.view-type a { - color: #ccc; - margin-left: 20px; - text-decoration: none; -} - -.view-type a.active, .view-type a:hover { - color: #343a40; -} - -.view-type a:first-child { - margin-left: 0; +.filters-wrap .filter-item:last-child { + margin-left: 15px; } diff --git a/src/components/filters/view-filter/index.js b/src/components/filters/view-filter/index.js new file mode 100644 index 0000000..64a458a --- /dev/null +++ b/src/components/filters/view-filter/index.js @@ -0,0 +1,20 @@ +import React from 'react'; + +import './styles.css'; + +const ViewFilter = (props) => ( + <div className="view-type-wrap"> + <div className="view-type btn shadowed cursor-default"> + <a href="#" className="active"> + <i className="fa fa-list mr-2"></i> + List + </a> + <a href="#"> + <i className="fa fa-table mr-2"></i> + Grid + </a> + </div> + </div> +); + +export default ViewFilter; diff --git a/src/components/filters/view-filter/styles.css b/src/components/filters/view-filter/styles.css new file mode 100644 index 0000000..af3cd97 --- /dev/null +++ b/src/components/filters/view-filter/styles.css @@ -0,0 +1,20 @@ +.view-type { + border-radius: 8px; + padding: 10px 20px; + background: white; + cursor: default; +} + +.view-type a { + color: #ccc; + margin-left: 20px; + text-decoration: none; +} + +.view-type a.active, .view-type a:hover { + color: #343a40; +} + +.view-type a:first-child { + margin-left: 0; +} diff --git a/src/global.css b/src/global.css index 336698a..635959a 100644 --- a/src/global.css +++ b/src/global.css @@ -9,6 +9,14 @@ body { border-radius: 8px; } +.cursor-default { + cursor: default !important; +} + +.shadowed { + box-shadow: 0 9px 62px -13px rgba(0, 0, 0, 0.20) !important; +} + .btn-primary { background: #1157ed; border-color: #1157ed; @@ -2,61 +2,6 @@ # yarn lockfile v1 -"@babel/helper-module-imports@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.51.tgz#ce00428045fbb7d5ebc0ea7bf835789f15366ab2" - dependencies: - "@babel/types" "7.0.0-beta.51" - lodash "^4.17.5" - -"@babel/types@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.51.tgz#d802b7b543b5836c778aa691797abf00f3d97ea9" - dependencies: - esutils "^2.0.2" - lodash "^4.17.5" - to-fast-properties "^2.0.0" - -"@emotion/babel-utils@^0.6.4": - version "0.6.9" - resolved "https://registry.yarnpkg.com/@emotion/babel-utils/-/babel-utils-0.6.9.tgz#bb074fadad65c443a575d3379488415fd194fc75" - dependencies: - "@emotion/hash" "^0.6.5" - "@emotion/memoize" "^0.6.5" - "@emotion/serialize" "^0.9.0" - convert-source-map "^1.5.1" - find-root "^1.1.0" - source-map "^0.7.2" - -"@emotion/hash@^0.6.2", "@emotion/hash@^0.6.5": - version "0.6.5" - resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.6.5.tgz#097729b84a5164f71f9acd2570ecfd1354d7b360" - -"@emotion/memoize@^0.6.1", "@emotion/memoize@^0.6.5": - version "0.6.5" - resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.6.5.tgz#f868c314b889e7c3d84868a1d1cc323fbb40ca86" - -"@emotion/serialize@^0.9.0": - version "0.9.0" - resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-0.9.0.tgz#ac5577cb98c7557c1a24a94cc101c5da6dc18322" - dependencies: - "@emotion/hash" "^0.6.5" - "@emotion/memoize" "^0.6.5" - "@emotion/unitless" "^0.6.6" - "@emotion/utils" "^0.8.1" - -"@emotion/stylis@^0.6.10": - version "0.6.12" - resolved "https://registry.yarnpkg.com/@emotion/stylis/-/stylis-0.6.12.tgz#3fb58220e0fc9e380bcabbb3edde396ddc1dfe6e" - -"@emotion/unitless@^0.6.2", "@emotion/unitless@^0.6.6": - version "0.6.6" - resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.6.6.tgz#988957ecd0a9be00ee9de27172f8c56d41595a93" - -"@emotion/utils@^0.8.1": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.8.1.tgz#f3a81587ad8d0ef33cdad6f3b4310774fcc1053e" - abab@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" @@ -436,7 +381,7 @@ babel-core@6.26.0: slash "^1.0.0" source-map "^0.5.6" -babel-core@^6.0.0, babel-core@^6.26.0, babel-core@^6.26.3: +babel-core@^6.0.0, babel-core@^6.26.0: version "6.26.3" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" dependencies: @@ -627,24 +572,6 @@ babel-plugin-dynamic-import-node@1.1.0: babel-template "^6.26.0" babel-types "^6.26.0" -babel-plugin-emotion@^9.2.6: - version "9.2.6" - resolved "https://registry.yarnpkg.com/babel-plugin-emotion/-/babel-plugin-emotion-9.2.6.tgz#992d48f316c20610c28a95ae90e6bd193014eec5" - dependencies: - "@babel/helper-module-imports" "7.0.0-beta.51" - "@emotion/babel-utils" "^0.6.4" - "@emotion/hash" "^0.6.2" - "@emotion/memoize" "^0.6.1" - "@emotion/stylis" "^0.6.10" - babel-core "^6.26.3" - babel-plugin-macros "^2.0.0" - babel-plugin-syntax-jsx "^6.18.0" - convert-source-map "^1.5.0" - find-root "^1.1.0" - mkdirp "^0.5.1" - source-map "^0.5.7" - touch "^1.0.0" - babel-plugin-istanbul@^4.0.0: version "4.1.6" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" @@ -658,12 +585,6 @@ babel-plugin-jest-hoist@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" -babel-plugin-macros@^2.0.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.4.0.tgz#6c5f9836e1f6c0a9743b3bab4af29f73e437e544" - dependencies: - cosmiconfig "^5.0.5" - babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" @@ -684,7 +605,7 @@ babel-plugin-syntax-flow@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" -babel-plugin-syntax-jsx@^6.18.0, babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: +babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" @@ -1519,10 +1440,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -classnames@^2.2.5: - version "2.2.6" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" - clean-css@4.1.x: version "4.1.11" resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.11.tgz#2ecdf145aba38f54740f26cefd0ff3e03e125d6a" @@ -1766,14 +1683,6 @@ cosmiconfig@^2.1.0, cosmiconfig@^2.1.1: parse-json "^2.2.0" require-from-string "^1.1.0" -cosmiconfig@^5.0.5: - version "5.0.6" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" - dependencies: - is-directory "^0.3.1" - js-yaml "^3.9.0" - parse-json "^4.0.0" - create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" @@ -1781,18 +1690,6 @@ create-ecdh@^4.0.0: bn.js "^4.1.0" elliptic "^6.0.0" -create-emotion@^9.2.6: - version "9.2.6" - resolved "https://registry.yarnpkg.com/create-emotion/-/create-emotion-9.2.6.tgz#f64cf1c64cf82fe7d22725d1d77498ddd2d39edb" - dependencies: - "@emotion/hash" "^0.6.2" - "@emotion/memoize" "^0.6.1" - "@emotion/stylis" "^0.6.10" - "@emotion/unitless" "^0.6.2" - csstype "^2.5.2" - stylis "^3.5.0" - stylis-rule-sheet "^0.0.10" - create-error-class@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" @@ -1950,10 +1847,6 @@ cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": dependencies: cssom "0.3.x" -csstype@^2.5.2: - version "2.5.6" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.5.6.tgz#2ae1db2319642d8b80a668d2d025c6196071e788" - currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -2166,10 +2059,6 @@ dom-converter@~0.1: dependencies: utila "~0.3" -dom-helpers@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.3.1.tgz#fc1a4e15ffdf60ddde03a480a9c0fece821dd4a6" - dom-serializer@0: version "0.1.0" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" @@ -2271,13 +2160,6 @@ emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" -emotion@^9.1.2: - version "9.2.6" - resolved "https://registry.yarnpkg.com/emotion/-/emotion-9.2.6.tgz#48517515e769bca6d8f7ff18425a7f133b010f22" - dependencies: - babel-plugin-emotion "^9.2.6" - create-emotion "^9.2.6" - encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -2307,7 +2189,7 @@ errno@^0.1.3, errno@~0.1.7: dependencies: prr "~1.0.1" -error-ex@^1.2.0, error-ex@^1.3.1: +error-ex@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" dependencies: @@ -2888,10 +2770,6 @@ find-cache-dir@^1.0.0: make-dir "^1.0.0" pkg-dir "^2.0.0" -find-root@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" - find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -4123,7 +4001,7 @@ js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.0, js-yaml@^3.9.1: +js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.9.1: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" dependencies: @@ -4177,10 +4055,6 @@ json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" @@ -4493,10 +4367,6 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" -memoize-one@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-4.0.0.tgz#fc5e2f1427a216676a62ec652cf7398cfad123db" - memory-fs@^0.4.0, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -4797,12 +4667,6 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - dependencies: - abbrev "1" - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" @@ -5081,13 +4945,6 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -5563,7 +5420,7 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2: +prop-types@^15.5.10, prop-types@^15.6.0, prop-types@^15.6.1: version "15.6.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" dependencies: @@ -5642,7 +5499,7 @@ querystringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.0.0.tgz#fa3ed6e68eb15159457c89b37bc6472833195755" -raf@3.4.0, raf@^3.4.0: +raf@3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.0.tgz#a28876881b4bc2ca9117d4138163ddb80f781575" dependencies: @@ -5727,16 +5584,6 @@ react-error-overlay@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-4.0.0.tgz#d198408a85b4070937a98667f500c832f86bd5d4" -react-input-autosize@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/react-input-autosize/-/react-input-autosize-2.2.1.tgz#ec428fa15b1592994fb5f9aa15bb1eb6baf420f8" - dependencies: - prop-types "^15.5.8" - -react-lifecycles-compat@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" - react-redux@^5.0.7: version "5.0.7" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-5.0.7.tgz#0dc1076d9afb4670f993ffaef44b8f8c1155a4c8" @@ -5816,27 +5663,6 @@ react-scripts@1.1.4: optionalDependencies: fsevents "^1.1.3" -react-select@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/react-select/-/react-select-2.0.0.tgz#7e7ba31eff360b37ffc52b343a720f4248bd9b3b" - dependencies: - classnames "^2.2.5" - emotion "^9.1.2" - memoize-one "^4.0.0" - prop-types "^15.6.0" - raf "^3.4.0" - react-input-autosize "^2.2.1" - react-transition-group "^2.2.1" - -react-transition-group@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.4.0.tgz#1d9391fabfd82e016f26fabd1eec329dbd922b5a" - dependencies: - dom-helpers "^3.3.1" - loose-envify "^1.3.1" - prop-types "^15.6.2" - react-lifecycles-compat "^3.0.4" - react@^16.4.2: version "16.4.2" resolved "https://registry.yarnpkg.com/react/-/react-16.4.2.tgz#2cd90154e3a9d9dd8da2991149fdca3c260e129f" @@ -6461,10 +6287,6 @@ source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" -source-map@^0.7.2: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - spdx-correct@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" @@ -6645,14 +6467,6 @@ style-loader@0.19.0: loader-utils "^1.0.2" schema-utils "^0.3.0" -stylis-rule-sheet@^0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz#44e64a2b076643f4b52e5ff71efc04d8c3c4a430" - -stylis@^3.5.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/stylis/-/stylis-3.5.3.tgz#99fdc46afba6af4deff570825994181a5e6ce546" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -6816,10 +6630,6 @@ to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" @@ -6846,12 +6656,6 @@ toposort@^1.0.0: version "1.0.7" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" -touch@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/touch/-/touch-1.0.0.tgz#449cbe2dbae5a8c8038e30d71fa0ff464947c4de" - dependencies: - nopt "~1.0.10" - tough-cookie@^2.3.2, tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" |
