Skip to content

Commit

Permalink
Merge pull request #167 from QUACK-INTEC/develop
Browse files Browse the repository at this point in the history
Test
  • Loading branch information
jtvargas authored Dec 28, 2019
2 parents 443f1fd + 984c53e commit a127680
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 121 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/main.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .yml

This file was deleted.

65 changes: 14 additions & 51 deletions App/Components/Calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Pill from '../FileInput/FilePill';

class Calendar extends React.Component {
leftText = () => {
return <Text.Medium text="Publico" style={styles.textGlobal} />;
return <Text.Medium text="Público" style={styles.textGlobal} />;
};

rightText = () => {
Expand All @@ -35,61 +35,23 @@ class Calendar extends React.Component {
);
};

renderClassInfoIndicator = () => {
renderInfoIndicators = () => {
const { showingPrivate } = this.props;
return (
<View>
<InLineComponent>
<InLineComponent>
<View style={styles.infoSubjectCalendar} />
<Text.Light text="Clases" style={styles.infoText} />
<Text.Light text="Clases" style={styles.classInfoText} />
</InLineComponent>
<InLineComponent>
<View style={styles.infoTransparentCalendar} />
<Text.Light text="Eventos" style={styles.transparentInfo} />
<View
style={[
styles.infoEventCalendar,
{ backgroundColor: showingPrivate ? colors.ORANGE_LIGHT : colors.PURPLE_LIGHT },
]}
/>
<Text.Light text="Eventos" style={styles.infoText} />
</InLineComponent>
</View>
);
};

renderEventPrivateInfoIndicator = () => {
return (
<InLineComponent>
<View style={styles.infoPrivateEventCalendar} />
<Text.Light text="Privado" style={styles.infoText} />
</InLineComponent>
);
};

renderEventInfoIndicator = () => {
return (
<InLineComponent>
<View style={styles.infoEventCalendar} />
<Text.Light text="Eventos" style={styles.infoText} />
</InLineComponent>
);
};

renderEventInfoIndicators = () => {
return (
<View>
{this.renderEventInfoIndicator()}
{this.renderEventPrivateInfoIndicator()}
</View>
// <InLineComponent
// leftChild={this.renderEventPrivateInfoIndicator}
// rightChild={this.renderEventInfoIndicator}
// >
// <View style={{ ...spacers.MA_14 }} />
// </InLineComponent>
);
};

renderInfoCalendar = () => {
return (
<InLineComponent
leftChild={this.renderClassInfoIndicator}
rightChild={this.renderEventInfoIndicators}
>
<View style={{ ...spacers.MA_14 }} />
</InLineComponent>
);
};
Expand Down Expand Up @@ -210,7 +172,7 @@ class Calendar extends React.Component {
}}
>
{hasFilter ? <Pill documentText={filterLabel} onPress={onQuitFilter} /> : null}
<View style={{ ...spacers.ML_10 }}>{this.renderInfoCalendar()}</View>
<View style={{ ...spacers.ML_10 }}>{this.renderInfoIndicators()}</View>
</View>
{isLoading ? (
<View style={{ alignItems: 'center', justifyContent: 'center', flex: 1 }}>
Expand Down Expand Up @@ -246,6 +208,7 @@ const styles = StyleSheet.create({
...spacers.MR_1,
},
infoText: { color: colors.GRAY },
classInfoText: { color: colors.GRAY, ...spacers.MR_8 },
infoEventCalendar: {
height: toBaseDesignPx(7),
width: toBaseDesignPx(7),
Expand Down
23 changes: 22 additions & 1 deletion App/Components/Common/DropDown/DropDown.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { fonts, colors, toBaseDesignPx, spacers } from '../../../Core/Theme';
// Common
import Text from '../Text';
import InLineComponent from '../InLineComponent';
import Icon, { ICON_TYPE, ICON_SIZE } from '../Icon';

class DropDownComponent extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -46,6 +47,20 @@ class DropDownComponent extends React.Component {
);
};

renderIcon = () => {
return (
<View style={styles.headerBackIconContainer}>
<Icon
name="chevron-down"
type={ICON_TYPE.FONT_AWESOME}
size={ICON_SIZE.XTINY}
color={colors.GRAY_LIGHT}
isButton={false}
/>
</View>
);
};

renderLabel = () => {
const { label, labelStyle, hasError } = this.props;
const errorLabelStyle = hasError ? styles.errorLabelStyle : null;
Expand All @@ -58,7 +73,6 @@ class DropDownComponent extends React.Component {
text={label}
style={[this.getLabelStyle(), errorLabelStyle, labelStyle]}
/>
<Text.SemiBold text=" ▼" style={[styles.triangle]} />
</View>
{this.renderErrorLabel()}
</InLineComponent>
Expand Down Expand Up @@ -115,9 +129,14 @@ class DropDownComponent extends React.Component {
style={{
inputIOS: [this.getDropDownStyle(), style],
inputAndroid: [this.getDropDownStyle(), style],
iconContainer: {
top: 5,
right: 15,
},
}}
value={valueFromState}
useNativeAndroidPickerStyle={false}
Icon={() => this.renderIcon()}
{...rest}
/>
</View>
Expand All @@ -144,12 +163,14 @@ const styles = StyleSheet.create({
color: colors.BLACK,
...spacers.MT_9,
...spacers.MB_14,
...spacers.PR_5,
},
dropDownDisabled: {
...fonts.SEMI_BOLD,
color: colors.DISABLED,
...spacers.MT_9,
...spacers.MB_14,
...spacers.PR_5,
},
errorLabelStyle: {
color: colors.ERROR,
Expand Down
6 changes: 1 addition & 5 deletions App/Components/Common/TimePicker/TimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ class TimePicker extends React.Component {
: Moment(props.time).minutes()
}`;
const timeDate = Moment(props.time).toDate();
const newDate = new Date(timeDate.getTime() + timeDate.getTimezoneOffset() * 60 * 1000);
const offset = timeDate.getTimezoneOffset() / 60;
const hours = timeDate.getHours();
newDate.setHours(hours + offset);
return {
date: strDate,
timePicked: newDate,
timePicked: timeDate,
};
}
return null;
Expand Down
16 changes: 5 additions & 11 deletions App/Components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Home extends React.Component {
const { actualMonth } = this.props;
return (
<View>
<Text.Bold text={`${Moment().format('DD dddd,')}`} style={styles.textToday} />
<Text.Bold text={`Hoy, ${Moment().format('dddd DD')}`} style={styles.textToday} />
<Text.Medium text={actualMonth} style={styles.textMonthActual} />
</View>
);
Expand All @@ -33,17 +33,11 @@ class Home extends React.Component {
<Text.Light text="Clases" style={styles.infoText} />
</InLineComponent>

<InLineComponent>
<View style={styles.infoTransparentCalendar} />
<Text.Light text="Eventos" style={styles.transparentInfo} />
</InLineComponent>
</View>

<View>
<InLineComponent>
<View style={styles.infoEventCalendar} />
<Text.Light text="Eventos" style={styles.infoText} />
<Text.Light text="Públicos" style={styles.infoText} />
</InLineComponent>

<InLineComponent>
<View style={styles.privateInfoSubjectCalendar} />
<Text.Light text="Privado" style={styles.infoPrivateText} />
Expand Down Expand Up @@ -203,7 +197,7 @@ const styles = StyleSheet.create({
width: toBaseDesignPx(7),
borderRadius: toBaseDesignPx(3.5),
backgroundColor: colors.ORANGE_LIGHT,
...spacers.MR_2,
...spacers.MR_1,
},
infoTransparentCalendar: {
height: toBaseDesignPx(7),
Expand All @@ -226,7 +220,7 @@ const styles = StyleSheet.create({
classesContainer: { ...spacers.MT_10 },
classesTitle: { ...fonts.SIZE_XXL, color: colors.GRAY },
infoText: { color: colors.GRAY },
infoPrivateText: { color: colors.GRAY, ...spacers.MR_1 },
infoPrivateText: { color: colors.GRAY },
transparentInfo: { color: colors.TRANSPARENT },
});

Expand Down
21 changes: 16 additions & 5 deletions App/Components/PostInfo/PostInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ class PostInfo extends React.Component {

renderResourceSection = () => {
const { hasResources, goToResources } = this.props;
console.log(hasResources);

if (hasResources) {
return (
Expand All @@ -279,6 +278,20 @@ class PostInfo extends React.Component {
return null;
};

renderDescriptionSection = () => {
const { postDescription } = this.props;

if (postDescription) {
return (
<Section title="Descripción" viewStyle={styles.sectionViewStyle}>
<Text.SemiBold text={postDescription} style={styles.infoStyle} />
</Section>
);
}

return null;
};

renderCommentsSection = () => {
const { isPrivate, goToComments } = this.props;

Expand All @@ -294,7 +307,7 @@ class PostInfo extends React.Component {
};

render() {
const { postTitle, postDescription, className, renderSubTasks } = this.props;
const { postTitle, className, renderSubTasks } = this.props;
return (
<View style={styles.container}>
<KeyboardAvoidingView style={styles.container} behavior="padding" enabled>
Expand All @@ -307,9 +320,7 @@ class PostInfo extends React.Component {
<Text.SemiBold text={className} style={styles.infoStyle} />
</Section>
{this.renderEventTime()}
<Section title="Descripción" viewStyle={styles.sectionViewStyle}>
<Text.SemiBold text={postDescription} style={styles.infoStyle} />
</Section>
{this.renderDescriptionSection()}
{this.renderCommentsSection()}
{this.renderResourceSection()}
{renderSubTasks()}
Expand Down
7 changes: 1 addition & 6 deletions App/Screens/Calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,4 @@ const mapStateToProps = (state, props) => {
};
};

export default WithLogger(
connect(
mapStateToProps,
null
)(Calendar)
);
export default WithLogger(connect(mapStateToProps, null)(Calendar));
15 changes: 13 additions & 2 deletions App/Screens/PostInfo/PostInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ class PostInfo extends React.Component {
section: postSectionId,
type: isPublic ? 'public' : 'private',
postId,
endDate: endDate ? Moment(endDate).utc() : null,
startDate: startDate ? Moment(startDate).utc() : null,
endDate: endDate ? this.convertDate(endDate) : null,
startDate: startDate ? this.convertDate(startDate) : null,
dateTime: startDate
? Moment(startDate)
.utc()
Expand All @@ -289,6 +289,17 @@ class PostInfo extends React.Component {
setModalVisible(true);
};

convertDate = date => {
const momentDate = Moment(date)
.utc()
.toDate();
const newDate = new Date(momentDate.getTime() + momentDate.getTimezoneOffset() * 60 * 1000);
const offset = momentDate.getTimezoneOffset() / 60;
const hours = momentDate.getHours();
newDate.setHours(hours + offset);
return newDate;
};

deletePost = () => {
const { logger } = this.props;
const { postId } = this.state;
Expand Down
18 changes: 1 addition & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6702,22 +6702,6 @@ node-notifier@^5.2.1, node-notifier@^5.4.2:
shellwords "^0.1.1"
which "^1.3.0"

node-pre-gyp@*:
version "0.14.0"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83"
integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==
dependencies:
detect-libc "^1.0.2"
mkdirp "^0.5.1"
needle "^2.2.1"
nopt "^4.0.1"
npm-packlist "^1.1.6"
npmlog "^4.0.2"
rc "^1.2.7"
rimraf "^2.6.1"
semver "^5.3.0"
tar "^4.4.2"

node-pre-gyp@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz#db1f33215272f692cd38f03238e3e9b47c5dd054"
Expand Down Expand Up @@ -9357,7 +9341,7 @@ table@^5.2.3:
slice-ansi "^2.1.0"
string-width "^3.0.0"

tar@^4, tar@^4.4.2:
tar@^4:
version "4.4.13"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525"
integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==
Expand Down

0 comments on commit a127680

Please sign in to comment.