0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

[NFC] Add display name for custom React components

This improves readability of "Components" tab from React Development Tools extension for Chrome
This commit is contained in:
Alexey Sachkov
2021-12-29 21:18:54 +03:00
parent 7b19bbb1a7
commit 8a3f52b704
23 changed files with 28 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ const PAGE_HEIGHT = 1056;
const PPR_THRESHOLD = 50;
const BrewRenderer = createClass({
displayName : 'BrewRenderer',
getDefaultProps : function() {
return {
text : '',

View File

@@ -5,6 +5,7 @@ const _ = require('lodash');
const cx = require('classnames');
const ErrorBar = createClass({
displayName : 'ErrorBar',
getDefaultProps : function() {
return {
errors : []

View File

@@ -7,6 +7,7 @@ const cx = require('classnames'); //Unused variable
const DISMISS_KEY = 'dismiss_notification09-9-21';
const NotificationPopup = createClass({
displayName : 'NotificationPopup',
getInitialState : function() {
return {
notifications : {}

View File

@@ -26,6 +26,7 @@ const splice = function(str, index, inject){
const Editor = createClass({
displayName : 'Editor',
getDefaultProps : function() {
return {
brew : {

View File

@@ -8,6 +8,7 @@ const request = require('superagent');
const SYSTEMS = ['5e', '4e', '3.5e', 'Pathfinder'];
const MetadataEditor = createClass({
displayName : 'MetadataEditor',
getDefaultProps : function() {
return {
metadata : {

View File

@@ -14,6 +14,7 @@ const execute = function(val, brew){
};
const Snippetbar = createClass({
displayName : 'SnippetBar',
getDefaultProps : function() {
return {
brew : {},
@@ -103,6 +104,7 @@ module.exports = Snippetbar;
const SnippetGroup = createClass({
displayName : 'SnippetGroup',
getDefaultProps : function() {
return {
brew : {},

View File

@@ -13,6 +13,7 @@ const NewPage = require('./pages/newPage/newPage.jsx');
const PrintPage = require('./pages/printPage/printPage.jsx');
const Homebrew = createClass({
displayName : 'Homebrewery',
getDefaultProps : function() {
return {
url : '',

View File

@@ -3,7 +3,7 @@ const createClass = require('create-react-class');
const Nav = require('naturalcrit/nav/nav.jsx');
const Account = createClass({
displayName : 'AccountNavItem',
getInitialState : function() {
return {
url : ''

View File

@@ -7,6 +7,7 @@ const MAX_TITLE_LENGTH = 50;
const EditTitle = createClass({
displayName : 'EditTitleNavItem',
getDefaultProps : function() {
return {
title : '',

View File

@@ -6,6 +6,7 @@ const Nav = require('naturalcrit/nav/nav.jsx');
const PatreonNavItem = require('./patreon.navitem.jsx');
const Navbar = createClass({
displayName : 'Navbar',
getInitialState : function() {
return {
//showNonChromeWarning : false,

View File

@@ -10,7 +10,7 @@ const VIEW_KEY = 'homebrewery-recently-viewed';
const RecentItems = createClass({
DisplayName : 'RecentItems',
getDefaultProps : function() {
return {
storageKey : '',

View File

@@ -8,6 +8,7 @@ const MAIN_URL = 'https://www.reddit.com/r/UnearthedArcana/submit?selftext=true'
const RedditShare = createClass({
displayName : 'RedditShareNavItem',
getDefaultProps : function() {
return {
brew : {

View File

@@ -27,6 +27,7 @@ const googleDriveInactive = require('../../googleDriveMono.png');
const SAVE_TIMEOUT = 3000;
const EditPage = createClass({
displayName : 'EditPage',
getDefaultProps : function() {
return {
brew : {

View File

@@ -21,6 +21,7 @@ const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
const HomePage = createClass({
displayName : 'HomePage',
getDefaultProps : function() {
return {
brew : {

View File

@@ -23,6 +23,7 @@ const METAKEY = 'homebrewery-new-meta';
const NewPage = createClass({
displayName : 'NewPage',
getDefaultProps : function() {
return {
brew : {

View File

@@ -12,6 +12,7 @@ const STYLEKEY = 'homebrewery-new-style';
const METAKEY = 'homebrewery-new-meta';
const PrintPage = createClass({
displayName : 'PrintPage',
getDefaultProps : function() {
return {
query : {},

View File

@@ -14,6 +14,7 @@ const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
const SharePage = createClass({
displayName : 'SharePage',
getDefaultProps : function() {
return {
brew : {

View File

@@ -10,6 +10,7 @@ const googleDriveIcon = require('../../../googleDrive.png');
const dedent = require('dedent-tabs').default;
const BrewItem = createClass({
displayName : 'BrewItem',
getDefaultProps : function() {
return {
brew : {

View File

@@ -24,6 +24,7 @@ const ReportIssue = require('../../navbar/issue.navitem.jsx');
const UserPage = createClass({
displayName : 'UserPage',
getDefaultProps : function() {
return {
username : '',

View File

@@ -7,6 +7,7 @@ const cx = require('classnames');
const DISMISS_KEY = 'dismiss_render_warning';
const RenderWarnings = createClass({
displayName : 'RenderWarnings',
getInitialState : function() {
return {
warnings : {}

View File

@@ -40,6 +40,7 @@ if(typeof navigator !== 'undefined'){
}
const CodeEditor = createClass({
displayName : 'CodeEditor',
getDefaultProps : function() {
return {
language : '',

View File

@@ -8,6 +8,7 @@ const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx');
const Nav = {
base : createClass({
displayName : 'Nav.base',
render : function(){
return <nav>
<div className='navContent'>
@@ -26,6 +27,7 @@ const Nav = {
},
section : createClass({
displayName : 'Nav.section',
render : function(){
return <div className='navSection'>
{this.props.children}
@@ -34,6 +36,7 @@ const Nav = {
}),
item : createClass({
displayName : 'Nav.item',
getDefaultProps : function() {
return {
icon : null,
@@ -69,6 +72,7 @@ const Nav = {
}),
dropdown : createClass({
displayName : 'Nav.dropdown',
getInitialState : function() {
return {
showDropdown : false

View File

@@ -5,6 +5,7 @@ const _ = require('lodash');
const cx = require('classnames');
const SplitPane = createClass({
displayName : 'SplitPane',
getDefaultProps : function() {
return {
storageKey : 'naturalcrit-pane-split',
@@ -77,6 +78,7 @@ const SplitPane = createClass({
});
const Pane = createClass({
displayName : 'Pane',
getDefaultProps : function() {
return {
width : null